Merged revisions 128856 via svnmerge from
[asterisk/asterisk.git] / apps / app_voicemail.c
index 9b3fa3f..f25811a 100644 (file)
@@ -2421,7 +2421,7 @@ static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, in
        char bound[256];
        char dur[256];
        struct ast_tm tm;
-       char enc_cidnum[256], enc_cidname[256];
+       char enc_cidnum[256] = "", enc_cidname[256] = "";
        char *passdata2;
        size_t len_passdata;
        char *greeting_attachment; 
@@ -2433,8 +2433,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, '@'))