"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/utils/js_tokenizer.l" between
snort3-3.1.31.0.tar.gz and snort3-3.1.32.0.tar.gz

About: Snort 3 is a network intrusion prevention and detection system (IDS/IPS) combining the benefits of signature, protocol and anomaly-based inspection.

js_tokenizer.l  (snort3-3.1.31.0):js_tokenizer.l  (snort3-3.1.32.0)
skipping to change at line 1011 skipping to change at line 1011
LITERAL_SQ_STRING_SKIP \\\'|\\\\ LITERAL_SQ_STRING_SKIP \\\'|\\\\
LITERAL_SQ_STRING_TEXT [^\\%<\xA\xD\xE2']{1,32}|. LITERAL_SQ_STRING_TEXT [^\\%<\xA\xD\xE2']{1,32}|.
LITERAL_TEMPLATE_START \` LITERAL_TEMPLATE_START \`
LITERAL_TEMPLATE_END \` LITERAL_TEMPLATE_END \`
LITERAL_TEMPLATE_SUBST_START \$\{ LITERAL_TEMPLATE_SUBST_START \$\{
LITERAL_TEMPLATE_TEXT [^\\%<$`]{1,32}|. LITERAL_TEMPLATE_TEXT [^\\%<$`]{1,32}|.
LITERAL_REGEX_START \/[^*\/] LITERAL_REGEX_START \/[^*\/]
LITERAL_REGEX_END \/[gimsuy]* LITERAL_REGEX_END \/[gimsuy]*
LITERAL_REGEX_SKIP \\\/|\\\\|\\\(|\\\)|\\\[|\\\]|\\\{|\\\} LITERAL_REGEX_SKIP \\\/|\\\\|\\\(|\\\)|\\\[|\\\]
LITERAL_REGEX_TEXT [^\\<\xA\xD\xE2/\(\)\[\]\{\}]{1,32}|. LITERAL_REGEX_TEXT [^\\<\xA\xD\xE2/\(\)\[\]]{1,32}|.
LITERAL_REGEX_G_OPEN \(|\[|\{ LITERAL_REGEX_G_OPEN \(|\[
LITERAL_REGEX_G_CLOSE \)|\]|\} LITERAL_REGEX_G_CLOSE \)|\]
/* extra literals */ /* extra literals */
/* according to https://ecma-international.org/ecma-262/5.1/#sec-4.3 */ /* according to https://ecma-international.org/ecma-262/5.1/#sec-4.3 */
LITERAL_UNDEFINED undefined LITERAL_UNDEFINED undefined
LITERAL_INFINITY Infinity|\xE2\x88\x9E LITERAL_INFINITY Infinity|\xE2\x88\x9E
LITERAL_NAN NaN LITERAL_NAN NaN
LITERAL {LITERAL_NULL}|{LITERAL_THIS}|{LITERAL_BOOLEAN}|{L ITERAL_DECIMAL}|{LITERAL_BIN_INTEGER}|{LITERAL_OCT_INTEGER}|{LITERAL_HEX_INTEGER }|{LITERAL_BIG_INTEGER}|{LITERAL_UNDEFINED}|{LITERAL_INFINITY}|{LITERAL_NAN} LITERAL {LITERAL_NULL}|{LITERAL_THIS}|{LITERAL_BOOLEAN}|{L ITERAL_DECIMAL}|{LITERAL_BIN_INTEGER}|{LITERAL_OCT_INTEGER}|{LITERAL_HEX_INTEGER }|{LITERAL_BIG_INTEGER}|{LITERAL_UNDEFINED}|{LITERAL_INFINITY}|{LITERAL_NAN}
HTML_COMMENT_OPEN "<"+"!--" HTML_COMMENT_OPEN "<"+"!--"
HTML_TAG_SCRIPT_OPEN "<"+(?i:script)[\x9\xA\xC\x20\x2f\x3e] HTML_TAG_SCRIPT_OPEN "<"+(?i:script)[\x9\xA\xC\x20\x2f\x3e]
HTML_TAG_SCRIPT_CLOSE "<"+(?i:\/script>) HTML_TAG_SCRIPT_CLOSE "<"+(?i:\/script>)
skipping to change at line 2335 skipping to change at line 2335
// special meaning only outside of a character class // special meaning only outside of a character class
if (regex_stack.empty() or regex_stack.top() != '[') if (regex_stack.empty() or regex_stack.top() != '[')
regex_stack.push(yytext[0]); regex_stack.push(yytext[0]);
ECHO; ECHO;
return EOS; return EOS;
} }
JSTokenizer::JSRet JSTokenizer::literal_regex_g_close() JSTokenizer::JSRet JSTokenizer::literal_regex_g_close()
{ {
char c_close = yytext[0]; switch (yytext[0])
if (regex_stack.empty())
{ {
// a raw bracket is allowed in regex w/o unicode flag, case ')':
// but the parser will accept a bracket in regex with unicode flag if (regex_stack.empty())
if (c_close == ']')
{ {
ECHO; debug_logf(5, http_trace, TRACE_JS_PROC, nullptr,
return EOS; "no group to close, .. %c\n", yytext[0]);
return BAD_TOKEN;
} }
else if (regex_stack.top() == '(')
regex_stack.pop();
else
assert(regex_stack.top() == '[');
debug_logf(5, http_trace, TRACE_JS_PROC, nullptr,
"no group to close, .. %c\n", yytext[0]);
return BAD_TOKEN;
}
char c_open = regex_stack.top();
bool mismatch = false;
switch (c_open)
{
case '(':
mismatch = c_close != ')';
regex_stack.pop();
break; break;
case '[': case ']':
// only the closing bracket has an effect in a character set if (regex_stack.empty())
if (c_close == ']') {
// a raw bracket is allowed in regex w/o unicode flag,
// but the parser will accept a bracket in regex with unicode flag
ECHO;
return EOS;
}
else if (regex_stack.top() == '[')
regex_stack.pop(); regex_stack.pop();
break; else
assert(regex_stack.top() == '(');
case '{':
mismatch = c_close != '}';
regex_stack.pop();
break; break;
default: default:
assert(false); assert(false);
mismatch = true;
}
if (mismatch)
{
debug_logf(5, http_trace, TRACE_JS_PROC, nullptr,
"closing symbol mismatch, %c .. %c\n", c_open, c_close);
return BAD_TOKEN;
} }
ECHO; ECHO;
return EOS; return EOS;
} }
void JSTokenizer::div_assignment_operator() void JSTokenizer::div_assignment_operator()
{ {
dealias_equals(true); dealias_equals(true);
 End of changes. 10 change blocks. 
40 lines changed or deleted 25 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)