mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-18 02:10:36 +03:00
Fix the "line counting" on parser errors
This commit is contained in:
@@ -340,12 +340,12 @@ CONFIG_DIR_UNICODE_MAP_FILE (?i:SecUnicodeMapFile)
|
||||
}
|
||||
|
||||
[\n]+ { driver.loc.back()->lines(yyleng); driver.loc.back()->step(); }
|
||||
#[ \t]*SecRule[^\\]*\\\n[ \t]* { BEGIN(COMMENT); }
|
||||
#[ \t]*SecRule[^\\]*\\\r\n[ \t]* { BEGIN(COMMENT); }
|
||||
#[ \t]*SecAction[^\\]*\\\n[ \t]* { BEGIN(COMMENT); }
|
||||
#[ \t]*SecAction[^\\]*\\\r\n[ \t]* { BEGIN(COMMENT); }
|
||||
#.* { /* comment, just ignore. */ }
|
||||
. { driver.error (*driver.loc.back(), "invalid character", yytext); }
|
||||
#[ \t]*SecRule[^\\]*\\\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); }
|
||||
#[ \t]*SecRule[^\\]*\\\r\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); }
|
||||
#[ \t]*SecAction[^\\]*\\\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); }
|
||||
#[ \t]*SecAction[^\\]*\\\r\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); }
|
||||
#.* { driver.loc.back()->step(); /* comment, just ignore. */ }
|
||||
. { driver.error (*driver.loc.back(), "invalid character", yytext); throw yy::seclang_parser::syntax_error(*driver.loc.back(), yytext); }
|
||||
<<EOF>> {
|
||||
if (driver.ref.size() > 0) {
|
||||
driver.ref.pop_back();
|
||||
|
||||
Reference in New Issue
Block a user