]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
If there was no named defined in a voicemail.conf mailbox
authorMark Michelson <mmichelson@digium.com>
Wed, 29 Oct 2008 20:53:53 +0000 (20:53 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 29 Oct 2008 20:53:53 +0000 (20:53 +0000)
entry, then app_directory would crash when attempting to
read that entry from the file. We now check for the NULL
or empty string properly so that there will be no crash.

(closes issue #13804)
Reported by: bluecrow76

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152646 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_directory.c

index 69523ec65eeab0c2a60d7bb0d62099177d4c39d7..30b8f7f46639e9f65a14e24464c9bf80fca38615 100644 (file)
@@ -131,6 +131,10 @@ static int compare(const char *text, const char *template)
 {
        char digit;
 
+       if (ast_strlen_zero(text)) {
+               return -1;
+       }
+
        while (*template) {
                digit = toupper(*text++);
                switch (digit) {