]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Check for non-NULL before stripping characters.
authorTilghman Lesher <tilghman@meg.abyt.es>
Tue, 8 Jul 2008 00:01:30 +0000 (00:01 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Tue, 8 Jul 2008 00:01:30 +0000 (00:01 +0000)
(closes issue #12954)
 Reported by: bfsworks
 Patches:
       20080701__bug12954.diff.txt uploaded by Corydon76 (license 14)
 Tested by: deti

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

apps/app_voicemail.c

index 2bf8bfd60ca2bae6e207f25e2d0d6b2bb26173bc..b60390ce7f2ab27c00e97f5638d3e53b6cf331d4 100644 (file)
@@ -1847,7 +1847,7 @@ static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, in
        char fname[256];
        char dur[256];
        char tmpcmd[256];
-       char enc_cidnum[256], enc_cidname[256];
+       char enc_cidnum[256] = "", enc_cidname[256] = "";
        struct tm tm;
        char *passdata2;
        size_t len_passdata;
@@ -1857,8 +1857,12 @@ static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, in
 #define ENDL "\n"
 #endif
 
-       strip_control(cidnum, enc_cidnum, sizeof(enc_cidnum));
-       strip_control(cidname, enc_cidname, sizeof(enc_cidname));
+       if (cidnum) {
+               strip_control(cidnum, enc_cidnum, sizeof(enc_cidnum));
+       }
+       if (cidname) {
+               strip_control(cidname, enc_cidname, sizeof(enc_cidname));
+       }
        gethostname(host, sizeof(host) - 1);
        if (strchr(srcemail, '@'))
                ast_copy_string(who, srcemail, sizeof(who));