aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_directory.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-09-24 07:44:46 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-09-24 07:44:46 +0000
commitef59bfe16eb3601e8cf922d49d3be6dca02ec36e (patch)
tree79fe64daf0aa6d094e07e0368992d2180a17660e /apps/app_directory.c
parent269003262493f3656baaa1b74ca0476efde912dc (diff)
Merged revisions 219987 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r219987 | tilghman | 2009-09-24 02:39:44 -0500 (Thu, 24 Sep 2009) | 8 lines Fix two possible crashes, one only in 1.6.1 and one in 1.6.1 forward. (closes issue #15739) Reported by: DLNoah, jeffg Patches: 20090914__issue15739.diff.txt uploaded by tilghman (license 14) 20090922__issue15739.diff.txt uploaded by tilghman (license 14) Tested by: DLNoah, jeffg ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@219988 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_directory.c')
-rw-r--r--apps/app_directory.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c
index ded4b85bf..fad117f49 100644
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -473,6 +473,11 @@ static int search_directory(const char *context, struct ast_config *vmcfg, struc
strsep(&bufptr, ",");
pos = strsep(&bufptr, ",");
+ /* No name to compare against */
+ if (ast_strlen_zero(pos)) {
+ continue;
+ }
+
res = 0;
if (ast_test_flag(&flags, OPT_LISTBYLASTNAME)) {
res = check_match(&item, pos, v->name, ext, 0 /* use_first_name */);
@@ -645,7 +650,7 @@ static int directory_exec(struct ast_channel *chan, void *data)
int res = 0, digit = 3;
struct ast_config *cfg, *ucfg;
const char *dirintro;
- char *parse, *opts[OPT_ARG_ARRAY_SIZE];
+ char *parse, *opts[OPT_ARG_ARRAY_SIZE] = { "", };
struct ast_flags flags = { 0 };
struct ast_flags config_flags = { 0 };
enum { FIRST, LAST, BOTH } which = LAST;