Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/parser/driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,14 @@
scan_begin();
yy::seclang_parser parser(*this);
parser.set_debug_level(trace_parsing);
int res = parser.parse();
int res;
try {
res = parser.parse();
} catch (...) {

Check warning on line 150 in src/parser/driver.cc

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

"catch" a specific exception type.

See more on https://sonarcloud.io/project/issues?id=owasp-modsecurity_ModSecurity&issues=AZ2Ci7InUwL1W3ZIPSI8&open=AZ2Ci7InUwL1W3ZIPSI8&pullRequest=3543
scan_end();
m_parserError << "Parser exception caught during rule parsing." << std::endl;
return 1;
}
scan_end();

/*
Expand Down
8 changes: 4 additions & 4 deletions src/parser/seclang-parser.hh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@


/**
** \file seclang-parser.tab.hh
** \file y.tab.h
** Define the yy::parser class.
*/

Expand All @@ -42,8 +42,8 @@
// especially those whose name start with YY_ or yy_. They are
// private implementation details that can be changed or removed.

#ifndef YY_YY_SECLANG_PARSER_TAB_HH_INCLUDED
# define YY_YY_SECLANG_PARSER_TAB_HH_INCLUDED
#ifndef YY_YY_SECLANG_PARSER_HH_INCLUDED
# define YY_YY_SECLANG_PARSER_HH_INCLUDED
// "%code requires" blocks.
#line 10 "seclang-parser.yy"

Expand Down Expand Up @@ -8892,4 +8892,4 @@ switch (yykind)



#endif // !YY_YY_SECLANG_PARSER_TAB_HH_INCLUDED
#endif // !YY_YY_SECLANG_PARSER_HH_INCLUDED
Loading
Loading