[asterisk-commits] russell: branch 1.4 r82644 - /branches/1.4/apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Sep 17 15:00:33 CDT 2007


Author: russell
Date: Mon Sep 17 15:00:32 2007
New Revision: 82644

URL: http://svn.digium.com/view/asterisk?view=rev&rev=82644
Log:
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.

Modified:
    branches/1.4/apps/app_voicemail.c

Modified: branches/1.4/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_voicemail.c?view=diff&rev=82644&r1=82643&r2=82644
==============================================================================
--- branches/1.4/apps/app_voicemail.c (original)
+++ branches/1.4/apps/app_voicemail.c Mon Sep 17 15:00:32 2007
@@ -1782,6 +1782,8 @@
 #else
 #define ENDL "\n"
 #endif
+
+	memset(&tm, 0, sizeof(tm));
 
 	gethostname(host, sizeof(host) - 1);
 	if (strchr(srcemail, '@'))
@@ -2049,8 +2051,12 @@
 {
 	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);
 }
 




More information about the asterisk-commits mailing list