diff options
author | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-02-25 21:00:50 +0000 |
---|---|---|
committer | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-02-25 21:00:50 +0000 |
commit | f268d815f558e72c74da6ca83dd5f1d3e46e81d0 (patch) | |
tree | c8d513eb1b9616a46f3b7298ee6626b477ee2ef2 | |
parent | 4b6504d8b49e10f95126c9e0bc0fa4716ae6e7dd (diff) |
This patch completes the fixes nec. to make 1.4 asterisk dialplan expressions ($[...]) 8-bit transparent
While I was updating ast_expr2.fl, I missed one rule that would allow 8-bit chars to be caught
in tokens; and in so doing, it absorbs the ${ sequence and messes up the
checking of raw exprs by AEL.
Trunk already has these changes.
(closes issue #14543)
Reported by: klaus3000
Patches:
patch.14543 uploaded by murf (license 17)
Tested by: murf
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@178640 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | main/ast_expr2.fl | 4 | ||||
-rw-r--r-- | main/ast_expr2f.c | 151 |
2 files changed, 80 insertions, 75 deletions
diff --git a/main/ast_expr2.fl b/main/ast_expr2.fl index f503740e8..b258726a1 100644 --- a/main/ast_expr2.fl +++ b/main/ast_expr2.fl @@ -91,8 +91,8 @@ int ast_yyget_column(yyscan_t yyscanner); static int curlycount = 0; static char *expr2_token_subst(const char *mess); %} - %option prefix="ast_yy" +%option 8bit %option batch %option outfile="ast_expr2f.c" %option reentrant @@ -152,7 +152,7 @@ HIBIT [\x80-\xff] return TOKEN; } -[a-zA-Z0-9,.';\\_^$#@{HIBIT}]+ { +([a-zA-Z0-9\.';\\_^#@]|{HIBIT}|($[^{]))+ { SET_COLUMNS; SET_STRING; return TOKEN; diff --git a/main/ast_expr2f.c b/main/ast_expr2f.c index fb9096fc1..c789ad3f9 100644 --- a/main/ast_expr2f.c +++ b/main/ast_expr2f.c @@ -360,14 +360,14 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[55] = +static yyconst flex_int16_t yy_accept[56] = { 0, 0, 0, 0, 0, 32, 32, 36, 35, 25, 27, - 19, 35, 29, 29, 17, 2, 22, 23, 15, 13, + 19, 35, 29, 35, 17, 2, 22, 23, 15, 13, 14, 16, 28, 20, 9, 3, 8, 18, 1, 35, - 31, 30, 32, 33, 33, 12, 0, 26, 29, 24, - 5, 28, 21, 11, 6, 7, 10, 4, 0, 31, - 30, 32, 34, 0 + 31, 30, 32, 33, 33, 12, 0, 26, 29, 0, + 24, 5, 28, 21, 11, 6, 7, 10, 4, 0, + 31, 30, 32, 34, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -376,7 +376,7 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 5, 6, 7, 8, 9, 6, 10, - 11, 12, 13, 6, 14, 6, 15, 16, 16, 16, + 11, 12, 13, 1, 14, 6, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 6, 18, 19, 20, 21, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, @@ -385,84 +385,88 @@ static yyconst flex_int32_t yy_ec[256] = 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 22, 23, 24, 25, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 + 6, 6, 22, 23, 24, 25, 1, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26 } ; -static yyconst flex_int32_t yy_meta[26] = +static yyconst flex_int32_t yy_meta[27] = { 0, - 1, 2, 2, 2, 1, 3, 4, 2, 2, 2, - 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, - 2, 3, 2, 3, 1 + 1, 2, 2, 2, 1, 1, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, + 2, 1, 2, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[61] = +static yyconst flex_int16_t yy_base[62] = { 0, - 0, 0, 4, 5, 29, 54, 56, 101, 101, 101, - 33, 45, 0, 27, 101, 39, 101, 101, 101, 101, - 101, 101, 31, 29, 25, 12, 24, 101, 19, 16, - 101, 101, 0, 101, 11, 101, 27, 101, 0, 0, - 101, 0, 101, 101, 101, 101, 101, 101, 17, 101, - 101, 0, 101, 101, 79, 83, 87, 89, 93, 97 + 0, 0, 5, 6, 30, 56, 60, 114, 114, 114, + 40, 53, 77, 31, 114, 42, 114, 114, 114, 114, + 114, 114, 34, 32, 29, 13, 28, 114, 22, 17, + 114, 114, 0, 114, 22, 114, 38, 114, 0, 12, + 114, 114, 0, 114, 114, 114, 114, 114, 114, 18, + 114, 114, 0, 114, 114, 103, 105, 107, 109, 111, + 32 } ; -static yyconst flex_int16_t yy_def[61] = +static yyconst flex_int16_t yy_def[62] = { 0, - 54, 1, 55, 55, 56, 56, 54, 54, 54, 54, - 54, 57, 58, 58, 54, 54, 54, 54, 54, 54, - 54, 54, 58, 54, 54, 54, 54, 54, 54, 59, - 54, 54, 60, 54, 54, 54, 57, 54, 58, 58, - 54, 23, 54, 54, 54, 54, 54, 54, 59, 54, - 54, 60, 54, 0, 54, 54, 54, 54, 54, 54 + 55, 1, 56, 56, 57, 57, 55, 55, 55, 55, + 55, 58, 55, 59, 55, 55, 55, 55, 55, 55, + 55, 55, 13, 55, 55, 55, 55, 55, 55, 60, + 55, 55, 61, 55, 55, 55, 58, 55, 13, 59, + 55, 55, 23, 55, 55, 55, 55, 55, 55, 60, + 55, 55, 61, 55, 0, 55, 55, 55, 55, 55, + 55 } ; -static yyconst flex_int16_t yy_nxt[127] = +static yyconst flex_int16_t yy_nxt[141] = { 0, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 13, 29, 13, 8, 31, 31, 32, 32, 33, - 45, 38, 53, 33, 33, 35, 46, 50, 50, 51, - 51, 48, 47, 44, 33, 43, 42, 41, 40, 38, - 33, 36, 33, 33, 33, 54, 54, 54, 33, 33, - 35, 54, 54, 54, 54, 54, 54, 54, 54, 33, - 54, 54, 54, 54, 54, 33, 54, 33, 33, 30, - 30, 30, 30, 34, 34, 34, 34, 37, 37, 37, - 37, 39, 39, 49, 49, 49, 49, 52, 54, 52, - - 7, 54, 54, 54, 54, 54, 54, 54, 54, 54, - 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, - 54, 54, 54, 54, 54, 54 + 28, 8, 29, 8, 8, 13, 31, 31, 32, 32, + 33, 46, 53, 55, 33, 33, 35, 47, 51, 51, + 52, 52, 38, 54, 49, 33, 48, 45, 44, 43, + 42, 33, 41, 33, 33, 33, 33, 38, 36, 55, + 33, 33, 35, 55, 55, 55, 55, 55, 55, 55, + 55, 33, 55, 55, 55, 55, 55, 33, 55, 33, + 33, 33, 39, 40, 55, 55, 55, 55, 55, 55, + 55, 55, 39, 55, 55, 55, 55, 55, 55, 55, + + 55, 55, 39, 30, 30, 34, 34, 37, 37, 39, + 39, 50, 50, 7, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55 } ; -static yyconst flex_int16_t yy_chk[127] = +static yyconst flex_int16_t yy_chk[141] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 4, 3, 4, 5, - 26, 37, 35, 5, 5, 5, 26, 30, 49, 30, - 49, 29, 27, 25, 5, 24, 23, 16, 14, 12, - 5, 11, 5, 5, 6, 7, 0, 0, 6, 6, - 6, 0, 0, 0, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 6, 6, 55, - 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, - 57, 58, 58, 59, 59, 59, 59, 60, 0, 60, - - 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, - 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, - 54, 54, 54, 54, 54, 54 + 1, 1, 1, 1, 1, 1, 3, 4, 3, 4, + 5, 26, 61, 40, 5, 5, 5, 26, 30, 50, + 30, 50, 37, 35, 29, 5, 27, 25, 24, 23, + 16, 5, 14, 5, 5, 5, 6, 12, 11, 7, + 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, + 0, 6, 0, 0, 0, 0, 0, 6, 0, 6, + 6, 6, 13, 13, 0, 0, 0, 0, 0, 0, + 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 13, 56, 56, 57, 57, 58, 58, 59, + 59, 60, 60, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55 } ; /* The intent behind this definition is that it'll catch @@ -566,7 +570,7 @@ int ast_yyget_column(yyscan_t yyscanner); static int curlycount = 0; static char *expr2_token_subst(const char *mess); -#line 570 "ast_expr2f.c" +#line 574 "ast_expr2f.c" #define INITIAL 0 #define var 1 @@ -812,7 +816,7 @@ YY_DECL #line 107 "ast_expr2.fl" -#line 816 "ast_expr2f.c" +#line 820 "ast_expr2f.c" yylval = yylval_param; @@ -875,13 +879,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 55 ) + if ( yy_current_state >= 56 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_current_state != 54 ); + while ( yy_current_state != 55 ); yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; @@ -1059,6 +1063,7 @@ YY_RULE_SETUP } YY_BREAK case 29: +/* rule 29 can match eol */ YY_RULE_SETUP #line 155 "ast_expr2.fl" { @@ -1137,7 +1142,7 @@ YY_RULE_SETUP #line 208 "ast_expr2.fl" ECHO; YY_BREAK -#line 1141 "ast_expr2f.c" +#line 1146 "ast_expr2f.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(var): yyterminate(); @@ -1433,7 +1438,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 55 ) + if ( yy_current_state >= 56 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1462,11 +1467,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 55 ) + if ( yy_current_state >= 56 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 54); + yy_is_jam = (yy_current_state == 55); return yy_is_jam ? 0 : yy_current_state; } |