[asterisk-commits] sgriepentrog: branch 11 r406245 - in /branches/11: ./ main/pbx.c utils/extconf.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 22 16:18:05 CST 2014


Author: sgriepentrog
Date: Wed Jan 22 16:18:03 2014
New Revision: 406245

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=406245
Log:
pbx.c: Pre-initialize timezone to avoid crash on destroy

In ast_build_timing, initialize the timezone value to NULL
in order to avoid deferencing an uninitialized value later
when calling ast_destroy_timing.  The timezone value could
be uninitialized if ast_build_timing were to fail due to a
zero length time string.

(closes issue ASTERISK-22861)
Reported by: Sebastian Murray-Roberts
Review: https://reviewboard.asterisk.org/r/3134/
Patches:
     ast_build_timing-initialize-timezone.patch uploaded by coreyfarrell (license 5909)
........

Merged revisions 406241 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/11/   (props changed)
    branches/11/main/pbx.c
    branches/11/utils/extconf.c

Propchange: branches/11/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/11/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/pbx.c?view=diff&rev=406245&r1=406244&r2=406245
==============================================================================
--- branches/11/main/pbx.c (original)
+++ branches/11/main/pbx.c Wed Jan 22 16:18:03 2014
@@ -9281,6 +9281,8 @@
 	char *info;
 	int j, num_fields, last_sep = -1;
 
+	i->timezone = NULL;
+
 	/* Check for empty just in case */
 	if (ast_strlen_zero(info_in)) {
 		return 0;
@@ -9300,8 +9302,6 @@
 	/* save the timezone, if it is specified */
 	if (num_fields == 5) {
 		i->timezone = ast_strdup(info + last_sep + 1);
-	} else {
-		i->timezone = NULL;
 	}
 
 	/* Assume everything except time */

Modified: branches/11/utils/extconf.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/utils/extconf.c?view=diff&rev=406245&r1=406244&r2=406245
==============================================================================
--- branches/11/utils/extconf.c (original)
+++ branches/11/utils/extconf.c Wed Jan 22 16:18:03 2014
@@ -4439,6 +4439,8 @@
 	char *info;
 	int j, num_fields, last_sep = -1;
 
+	i->timezone = NULL;
+
 	/* Check for empty just in case */
 	if (ast_strlen_zero(info_in)) {
 		return 0;
@@ -4458,8 +4460,6 @@
 	/* save the timezone, if it is specified */
 	if (num_fields == 5) {
 		i->timezone = ast_strdup(info + last_sep + 1);
-	} else {
-		i->timezone = NULL;
 	}
 
 	/* Assume everything except time */




More information about the asterisk-commits mailing list