Skip to content

Commit 23e0d35

Browse files
author
Felipe Zimmerle
committed
Fix the SecUnicodeMapFile and SecUnicodeCodePage
1 parent 3d83ed2 commit 23e0d35

File tree

10 files changed

+6802
-6535
lines changed

10 files changed

+6802
-6535
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
v3.0.3 - YYYY-MMM-DD (to be released)
22
-------------------------------------
33

4+
- Fix the SecUnicodeMapFile and SecUnicodeCodePage
5+
[xxxx - @zimmerle]
46
- Changes the timing to save the rule message
57
[0xca270 - @zimmerle]
68
- Fix crash in msc_rules_add_file() when using disruptive action in chain

headers/modsecurity/rules_properties.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ class ConfigSet {
8282

8383
class ConfigUnicodeMap {
8484
public:
85-
ConfigUnicodeMap() : m_set(false), m_unicode_map_table(NULL) { }
85+
ConfigUnicodeMap() : m_set(false), m_unicode_map_table(NULL), m_unicode_codepage(0) { }
8686
bool m_set;
8787
int *m_unicode_map_table;
88+
unsigned long int m_unicode_codepage;
8889
};
8990

9091
class RulesProperties {
@@ -352,6 +353,8 @@ class RulesProperties {
352353
if (from->m_unicodeMapTable.m_set == true) {
353354
to->m_unicodeMapTable.m_unicode_map_table = \
354355
from->m_unicodeMapTable.m_unicode_map_table;
356+
to->m_unicodeMapTable.m_unicode_codepage = \
357+
from->m_unicodeMapTable.m_unicode_codepage;
355358
to->m_unicodeMapTable.m_set = true;
356359
}
357360

src/parser/location.hh

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

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

@@ -42,7 +42,7 @@
4242

4343

4444
namespace yy {
45-
#line 46 "location.hh" // location.cc:292
45+
#line 46 "location.hh" // location.cc:290
4646
/// Abstract a location.
4747
class location
4848
{
@@ -167,7 +167,7 @@ namespace yy {
167167
** Avoid duplicate information.
168168
*/
169169
template <typename YYChar>
170-
inline std::basic_ostream<YYChar>&
170+
std::basic_ostream<YYChar>&
171171
operator<< (std::basic_ostream<YYChar>& ostr, const location& loc)
172172
{
173173
unsigned end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;
@@ -185,5 +185,5 @@ namespace yy {
185185

186186

187187
} // yy
188-
#line 189 "location.hh" // location.cc:292
188+
#line 189 "location.hh" // location.cc:290
189189
#endif // !YY_YY_LOCATION_HH_INCLUDED

src/parser/position.hh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// A Bison parser, made by GNU Bison 3.0.5.
1+
// A Bison parser, made by GNU Bison 3.1.
22

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

@@ -52,7 +52,7 @@
5252

5353

5454
namespace yy {
55-
#line 56 "position.hh" // location.cc:292
55+
#line 56 "position.hh" // location.cc:290
5656
/// Abstract a position.
5757
class position
5858
{
@@ -104,12 +104,10 @@ namespace yy {
104104
unsigned column;
105105

106106
private:
107-
/// Compute max(min, lhs+rhs) (provided min <= lhs).
108-
static unsigned add_ (unsigned lhs, int rhs, unsigned min)
107+
/// Compute max(min, lhs+rhs).
108+
static unsigned add_ (unsigned lhs, int rhs, int min)
109109
{
110-
return (0 < rhs || -static_cast<unsigned>(rhs) < lhs
111-
? rhs + lhs
112-
: min);
110+
return static_cast<unsigned>(std::max(min, static_cast<int>(lhs) + rhs));
113111
}
114112
};
115113

@@ -165,7 +163,7 @@ namespace yy {
165163
** \param pos a reference to the position to redirect
166164
*/
167165
template <typename YYChar>
168-
inline std::basic_ostream<YYChar>&
166+
std::basic_ostream<YYChar>&
169167
operator<< (std::basic_ostream<YYChar>& ostr, const position& pos)
170168
{
171169
if (pos.filename)
@@ -175,5 +173,5 @@ namespace yy {
175173

176174

177175
} // yy
178-
#line 179 "position.hh" // location.cc:292
176+
#line 177 "position.hh" // location.cc:290
179177
#endif // !YY_YY_POSITION_HH_INCLUDED

0 commit comments

Comments
 (0)