diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-09-17 20:00:32 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-09-17 20:00:32 +0000 |
commit | 07e503d2075c10e6a2e9713cee404db1af21e61d (patch) | |
tree | 885bfceb2fcd48ea59d6d9e051c0cbdacb3702ad /apps | |
parent | 9c8bfa0c65f722919e1b7f9e2c912db08ca1e1e9 (diff) |
Initialize some memory to fix crashes when leaving voicemail. This problem
was fixed by running Asterisk under valgrind.
(closes issue #10746, reported by arcivanov, patched by me)
*** IMPORTANT NOTE: We need to check to see if this same bug exists elsewhere.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@82644 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_voicemail.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 4c41ce445..d3d29e606 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -1783,6 +1783,8 @@ static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, in #define ENDL "\n" #endif + memset(&tm, 0, sizeof(tm)); + gethostname(host, sizeof(host) - 1); if (strchr(srcemail, '@')) ast_copy_string(who, srcemail, sizeof(who)); @@ -2049,8 +2051,12 @@ static int get_date(char *s, int len) { struct tm tm; time_t t; - t = time(0); + + time(&t); + memset(&tm, 0, sizeof(tm)); + ast_localtime(&t, &tm, NULL); + return strftime(s, len, "%a %b %e %r %Z %Y", &tm); } |