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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@271399 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Jeff Peeler 15 years ago
parent aafa3c7464
commit 11816dd222

@ -3200,10 +3200,10 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement,
#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 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement,
break;
}
}
free(buf1);
free(buf2);
free(new_label);
}
void set_priorities(struct ael_extension *exten)

Loading…
Cancel
Save