Fix two possible crashes, one only in 1.6.1 and one in 1.6.1 forward.
authorTilghman Lesher <tilghman@meg.abyt.es>
Thu, 24 Sep 2009 07:39:44 +0000 (07:39 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Thu, 24 Sep 2009 07:39:44 +0000 (07:39 +0000)
(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: https://origsvn.digium.com/svn/asterisk/trunk@219987 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_directory.c

index e1f5fb2..34001ad 100644 (file)
@@ -525,6 +525,11 @@ static int search_directory_sub(const char *context, struct ast_config *vmcfg, s
                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, context, pos, v->name, ext, 0 /* use_first_name */);