[asterisk-commits] jpeeler: branch 1.4 r271399 - /branches/1.4/pbx/pbx_ael.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 18 14:28:29 CDT 2010


Author: jpeeler
Date: Fri Jun 18 14:28:24 2010
New Revision: 271399

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=271399
Log:
Fix crash when parsing some heavily nested statements in AEL on reload.

Due to the recursion used when compiling AEL in gen_prios, all the stack space 
was being consumed when parsing some AEL that contained nesting 13 levels deep.
Changing a few large buffers to be heap allocated fixed the crash, although I
did not test how many more levels can now be safely used.

(closes issue #16053)
Reported by: diLLec
Tested by: jpeeler

Modified:
    branches/1.4/pbx/pbx_ael.c

Modified: branches/1.4/pbx/pbx_ael.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/pbx/pbx_ael.c?view=diff&rev=271399&r1=271398&r2=271399
==============================================================================
--- branches/1.4/pbx/pbx_ael.c (original)
+++ branches/1.4/pbx/pbx_ael.c Fri Jun 18 14:28:24 2010
@@ -3200,10 +3200,10 @@
 #ifdef OLD_RAND_ACTION
 	struct ael_priority *rand_test, *rand_end, *rand_skip;
 #endif
-	char buf1[2000];
-	char buf2[2000];
+	char *buf1 = malloc(2000);
+	char *buf2 = malloc(2000);
+	char *new_label = malloc(2000);
 	char *strp, *strp2;
-	char new_label[2000];
 	int default_exists;
 	int local_control_statement_count;
 	struct ael_priority *loop_break_save;
@@ -4035,6 +4035,9 @@
 			break;
 		}
 	}
+	free(buf1);
+	free(buf2);
+	free(new_label);
 }
 
 void set_priorities(struct ael_extension *exten)




More information about the asterisk-commits mailing list