mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Encapsulates int[N] in a class to avoid compilation issues
Depending on the compiler, there may be a compilation issue with the usage of std::unique_ptr<int[]>. Therefore encapsulating it inside a regular class.
This commit is contained in:
@@ -82,6 +82,22 @@ class ConfigSet {
|
||||
};
|
||||
|
||||
|
||||
class UnicodeMapHolder {
|
||||
public:
|
||||
UnicodeMapHolder() {
|
||||
memset(m_data, -1, (sizeof(int)*65536));
|
||||
};
|
||||
|
||||
int& operator[](int index) { return m_data[index]; }
|
||||
int operator[](int index) const { return m_data[index]; }
|
||||
|
||||
int at(int index) const { return m_data[index]; }
|
||||
void change(int i, int a) { m_data[i] = a; }
|
||||
|
||||
int m_data[65536];
|
||||
};
|
||||
|
||||
|
||||
class RulesProperties;
|
||||
class ConfigUnicodeMap {
|
||||
public:
|
||||
@@ -106,7 +122,7 @@ class ConfigUnicodeMap {
|
||||
|
||||
bool m_set;
|
||||
double m_unicodeCodePage;
|
||||
std::shared_ptr<int[]> m_unicodeMapTable;
|
||||
std::shared_ptr<modsecurity::UnicodeMapHolder> m_unicodeMapTable;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user