aboutsummaryrefslogtreecommitdiffstats
path: root/pbx
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-20 17:43:02 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-20 17:43:02 +0000
commitc97044b19caa1897bf5f7c452538bded9d8633a9 (patch)
tree413d41b1ec8e49a99ca8f7ca676d24f02f7c488f /pbx
parent6d2b0731ea49c44167befa9bfb7569a446af666a (diff)
The fix for the AEL <<security hole>> (bug 9316) is here...
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@59069 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r--pbx/pbx_ael.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/pbx/pbx_ael.c b/pbx/pbx_ael.c
index 6b787b8e0..85debdc99 100644
--- a/pbx/pbx_ael.c
+++ b/pbx/pbx_ael.c
@@ -3055,7 +3055,7 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement,
switch_end = new_prio();
switch_test->type = AEL_APPCALL;
switch_end->type = AEL_APPCALL;
- snprintf(buf1,sizeof(buf1),"sw-%d-%s|1",control_statement_count, p->u1.str);
+ snprintf(buf1,sizeof(buf1),"sw-%d-%s|10",control_statement_count, p->u1.str);
switch_test->app = strdup("Goto");
switch_test->appargs = strdup(buf1);
snprintf(buf1,sizeof(buf1),"Finish switch-%s-%d", label, control_statement_count);
@@ -3077,6 +3077,7 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement,
/* ok, generate a extension and link it in */
switch_case = new_exten();
switch_case->context = this_context;
+ switch_case->is_switch = 1;
/* the break/continue locations are inherited from parent */
switch_case->loop_break = exten->loop_break;
switch_case->loop_continue = exten->loop_continue;
@@ -3100,7 +3101,7 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement,
fall_thru = new_prio();
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
- snprintf(buf1,sizeof(buf1),"sw-%d-%s|1",local_control_statement_count, p2->next->u1.str);
+ snprintf(buf1,sizeof(buf1),"sw-%d-%s|10",local_control_statement_count, p2->next->u1.str);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru);
} else if (p2->next && p2->next->type == PV_PATTERN) {
@@ -3108,14 +3109,14 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement,
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
gen_match_to_pattern(p2->next->u1.str, buf2);
- snprintf(buf1,sizeof(buf1),"sw-%d-%s|1", local_control_statement_count, buf2);
+ snprintf(buf1,sizeof(buf1),"sw-%d-%s|10", local_control_statement_count, buf2);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru);
} else if (p2->next && p2->next->type == PV_DEFAULT) {
fall_thru = new_prio();
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
- snprintf(buf1,sizeof(buf1),"sw-%d-.|1",local_control_statement_count);
+ snprintf(buf1,sizeof(buf1),"sw-%d-.|10",local_control_statement_count);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru);
} else if (!p2->next) {
@@ -3140,6 +3141,7 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement,
/* ok, generate a extension and link it in */
switch_case = new_exten();
switch_case->context = this_context;
+ switch_case->is_switch = 1;
/* the break/continue locations are inherited from parent */
switch_case->loop_break = exten->loop_break;
switch_case->loop_continue = exten->loop_continue;
@@ -3162,7 +3164,7 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement,
fall_thru = new_prio();
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
- snprintf(buf1,sizeof(buf1),"sw-%d-%s|1",local_control_statement_count, p2->next->u1.str);
+ snprintf(buf1,sizeof(buf1),"sw-%d-%s|10",local_control_statement_count, p2->next->u1.str);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru);
} else if (p2->next && p2->next->type == PV_PATTERN) {
@@ -3170,14 +3172,14 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement,
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
gen_match_to_pattern(p2->next->u1.str, buf2);
- snprintf(buf1,sizeof(buf1),"sw-%d-%s|1",local_control_statement_count, buf2);
+ snprintf(buf1,sizeof(buf1),"sw-%d-%s|10",local_control_statement_count, buf2);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru);
} else if (p2->next && p2->next->type == PV_DEFAULT) {
fall_thru = new_prio();
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
- snprintf(buf1,sizeof(buf1),"sw-%d-.|1",local_control_statement_count);
+ snprintf(buf1,sizeof(buf1),"sw-%d-.|10",local_control_statement_count);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru);
} else if (!p2->next) {
@@ -3203,6 +3205,7 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement,
/* ok, generate a extension and link it in */
switch_case = new_exten();
switch_case->context = this_context;
+ switch_case->is_switch = 1;
/* the break/continue locations are inherited from parent */
switch_case->loop_break = exten->loop_break;
switch_case->loop_continue = exten->loop_continue;
@@ -3226,7 +3229,7 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement,
fall_thru = new_prio();
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
- snprintf(buf1,sizeof(buf1),"sw-%d-%s|1",local_control_statement_count, p2->next->u1.str);
+ snprintf(buf1,sizeof(buf1),"sw-%d-%s|10",local_control_statement_count, p2->next->u1.str);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru);
} else if (p2->next && p2->next->type == PV_PATTERN) {
@@ -3234,14 +3237,14 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement,
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
gen_match_to_pattern(p2->next->u1.str, buf2);
- snprintf(buf1,sizeof(buf1),"sw-%d-%s|1",local_control_statement_count, buf2);
+ snprintf(buf1,sizeof(buf1),"sw-%d-%s|10",local_control_statement_count, buf2);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru);
} else if (p2->next && p2->next->type == PV_DEFAULT) {
fall_thru = new_prio();
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
- snprintf(buf1,sizeof(buf1),"sw-%d-.|1",local_control_statement_count);
+ snprintf(buf1,sizeof(buf1),"sw-%d-.|10",local_control_statement_count);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru);
} else if (!p2->next) {
@@ -3513,7 +3516,9 @@ void set_priorities(struct ael_extension *exten)
int i;
struct ael_priority *pr;
do {
- if (exten->regexten)
+ if (exten->is_switch)
+ i = 10;
+ else if (exten->regexten)
i=2;
else
i=1;