Skip to content

Commit 5a5b33d

Browse files
committed
Respond to code review feedback
1 parent d881efe commit 5a5b33d

File tree

15 files changed

+2537
-2528
lines changed

15 files changed

+2537
-2528
lines changed

headers/modsecurity/transaction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class TransactionAnchoredVariables {
134134
m_variableInboundDataError(t, "INBOUND_DATA_ERROR"),
135135
m_variableMatchedVar(t, "MATCHED_VAR"),
136136
m_variableMatchedVarName(t, "MATCHED_VAR_NAME"),
137-
m_variableMscPcreErrored(t, "MSC_PCRE_ERRORED"),
137+
m_variableMscPcreError(t, "MSC_PCRE_ERROR"),
138138
m_variableMscPcreLimitsExceeded(t, "MSC_PCRE_LIMITS_EXCEEDED"),
139139
m_variableMultipartBoundaryQuoted(t, "MULTIPART_BOUNDARY_QUOTED"),
140140
m_variableMultipartBoundaryWhiteSpace(t,
@@ -221,7 +221,7 @@ class TransactionAnchoredVariables {
221221
AnchoredVariable m_variableInboundDataError;
222222
AnchoredVariable m_variableMatchedVar;
223223
AnchoredVariable m_variableMatchedVarName;
224-
AnchoredVariable m_variableMscPcreErrored;
224+
AnchoredVariable m_variableMscPcreError;
225225
AnchoredVariable m_variableMscPcreLimitsExceeded;
226226
AnchoredVariable m_variableMultipartBoundaryQuoted;
227227
AnchoredVariable m_variableMultipartBoundaryWhiteSpace;

src/operators/rx.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ bool Rx::evaluate(Transaction *transaction, RuleWithActions *rule,
6868

6969
// FIXME: DRY regex error reporting. This logic is currently duplicated in other operators.
7070
if (regex_result != Utils::RegexResult::Ok) {
71-
transaction->m_variableMscPcreErrored.set("1", transaction->m_variableOffset);
71+
transaction->m_variableMscPcreError.set("1", transaction->m_variableOffset);
7272

7373
std::string regex_error_str = "OTHER";
7474
if (regex_result == Utils::RegexResult::ErrorMatchLimit) {

src/operators/rx_global.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ bool RxGlobal::evaluate(Transaction *transaction, RuleWithActions *rule,
6262

6363
// FIXME: DRY regex error reporting. This logic is currently duplicated in other operators.
6464
if (regex_result != Utils::RegexResult::Ok) {
65-
transaction->m_variableMscPcreErrored.set("1", transaction->m_variableOffset);
65+
transaction->m_variableMscPcreError.set("1", transaction->m_variableOffset);
6666

6767
std::string regex_error_str = "OTHER";
6868
if (regex_result == Utils::RegexResult::ErrorMatchLimit) {

src/parser/location.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// A Bison parser, made by GNU Bison 3.7.5.
1+
// A Bison parser, made by GNU Bison 3.8.2.
22

33
// Locations for Bison parsers in C++
44

@@ -15,7 +15,7 @@
1515
// GNU General Public License for more details.
1616

1717
// You should have received a copy of the GNU General Public License
18-
// along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1919

2020
// As a special exception, you may create a larger work that contains
2121
// part or all of the Bison parser skeleton and distribute that work

src/parser/position.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// A Bison parser, made by GNU Bison 3.7.5.
1+
// A Bison parser, made by GNU Bison 3.8.2.
22

33
// Starting with Bison 3.2, this file is useless: the structure it
44
// used to define is now defined in "location.hh".

src/parser/seclang-parser.cc

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// A Bison parser, made by GNU Bison 3.7.5.
1+
// A Bison parser, made by GNU Bison 3.8.2.
22

33
// Skeleton implementation for Bison LALR(1) parsers in C++
44

@@ -15,7 +15,7 @@
1515
// GNU General Public License for more details.
1616

1717
// You should have received a copy of the GNU General Public License
18-
// along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1919

2020
// As a special exception, you may create a larger work that contains
2121
// part or all of the Bison parser skeleton and distribute that work
@@ -157,9 +157,9 @@ namespace yy {
157157
seclang_parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW
158158
{}
159159

160-
/*---------------.
161-
| symbol kinds. |
162-
`---------------*/
160+
/*---------.
161+
| symbol. |
162+
`---------*/
163163

164164

165165

@@ -1230,7 +1230,7 @@ namespace yy {
12301230
}
12311231

12321232
void
1233-
seclang_parser::yypop_ (int n)
1233+
seclang_parser::yypop_ (int n) YY_NOEXCEPT
12341234
{
12351235
yystack_.pop (n);
12361236
}
@@ -1273,13 +1273,13 @@ namespace yy {
12731273
}
12741274

12751275
bool
1276-
seclang_parser::yy_pact_value_is_default_ (int yyvalue)
1276+
seclang_parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT
12771277
{
12781278
return yyvalue == yypact_ninf_;
12791279
}
12801280

12811281
bool
1282-
seclang_parser::yy_table_value_is_error_ (int yyvalue)
1282+
seclang_parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT
12831283
{
12841284
return yyvalue == yytable_ninf_;
12851285
}
@@ -4273,10 +4273,10 @@ namespace yy {
42734273
#line 4274 "seclang-parser.cc"
42744274
break;
42754275

4276-
case 275: // var: "MSC_PCRE_ERRORED"
4276+
case 275: // var: "MSC_PCRE_ERROR"
42774277
#line 2327 "seclang-parser.yy"
42784278
{
4279-
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr<Variable> > (), new variables::MscPcreErrored());
4279+
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr<Variable> > (), new variables::MscPcreError());
42804280
}
42814281
#line 4282 "seclang-parser.cc"
42824282
break;
@@ -5938,16 +5938,16 @@ namespace yy {
59385938
// Actual number of expected tokens
59395939
int yycount = 0;
59405940

5941-
int yyn = yypact_[+yyparser_.yystack_[0].state];
5941+
const int yyn = yypact_[+yyparser_.yystack_[0].state];
59425942
if (!yy_pact_value_is_default_ (yyn))
59435943
{
59445944
/* Start YYX at -YYN if negative to avoid negative indexes in
59455945
YYCHECK. In other words, skip the first -YYN actions for
59465946
this state because they are default actions. */
5947-
int yyxbegin = yyn < 0 ? -yyn : 0;
5947+
const int yyxbegin = yyn < 0 ? -yyn : 0;
59485948
// Stay within bounds of both yycheck and yytname.
5949-
int yychecklim = yylast_ - yyn + 1;
5950-
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
5949+
const int yychecklim = yylast_ - yyn + 1;
5950+
const int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
59515951
for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
59525952
if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror
59535953
&& !yy_table_value_is_error_ (yytable_[yyx + yyn]))
@@ -5968,6 +5968,9 @@ namespace yy {
59685968

59695969

59705970

5971+
5972+
5973+
59715974
int
59725975
seclang_parser::yy_syntax_error_arguments_ (const context& yyctx,
59735976
symbol_kind_type yyarg[], int yyargn) const
@@ -7051,7 +7054,7 @@ namespace yy {
70517054
"VARIABLE_RULE", "\"Variable ARGS_NAMES\"", "VARIABLE_ARGS_POST_NAMES",
70527055
"\"AUTH_TYPE\"", "\"FILES_COMBINED_SIZE\"", "\"FILES_TMPNAMES\"",
70537056
"\"FULL_REQUEST\"", "\"FULL_REQUEST_LENGTH\"", "\"INBOUND_DATA_ERROR\"",
7054-
"\"MATCHED_VAR\"", "\"MATCHED_VAR_NAME\"", "\"MSC_PCRE_ERRORED\"",
7057+
"\"MATCHED_VAR\"", "\"MATCHED_VAR_NAME\"", "\"MSC_PCRE_ERROR\"",
70557058
"\"MSC_PCRE_LIMITS_EXCEEDED\"", "VARIABLE_MULTIPART_BOUNDARY_QUOTED",
70567059
"VARIABLE_MULTIPART_BOUNDARY_WHITESPACE", "\"MULTIPART_CRLF_LF_LINES\"",
70577060
"\"MULTIPART_DATA_AFTER\"", "VARIABLE_MULTIPART_DATA_BEFORE",
@@ -7296,7 +7299,7 @@ namespace yy {
72967299

72977300

72987301
} // yy
7299-
#line 7300 "seclang-parser.cc"
7302+
#line 7303 "seclang-parser.cc"
73007303

73017304
#line 3075 "seclang-parser.yy"
73027305

0 commit comments

Comments
 (0)