From: Tilghman Lesher Date: Tue, 8 Jul 2008 00:01:30 +0000 (+0000) Subject: Check for non-NULL before stripping characters. X-Git-Tag: 1.4.22-rc1~141 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=37d56a983f3f81dad28bb148ed93f460114b0534;p=thirdparty%2Fasterisk.git Check for non-NULL before stripping characters. (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 --- diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 2bf8bfd60c..b60390ce7f 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -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));