mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Test case skeleton for #1941
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1735,11 +1735,38 @@ expression:
|
||||
char *ucode = NULL, *hmap = NULL;
|
||||
int processing = 0;
|
||||
|
||||
std::string file = modsecurity::utils::find_resource($1,
|
||||
std::vector<std::string> param = utils::string::ssplit($1, ' ');
|
||||
if (param.size() <= 1) {
|
||||
std::stringstream ss;
|
||||
ss << "Failed to process unicode map, missing parameter: " << $1 << " ";
|
||||
ss << err;
|
||||
driver.error(@0, ss.str());
|
||||
YYERROR;
|
||||
}
|
||||
|
||||
int num = 0;
|
||||
try {
|
||||
num = std::stod(param.back());
|
||||
} catch (...) {
|
||||
std::stringstream ss;
|
||||
ss << "Failed to process unicode map, last parameter is expected to be a number: " << param.back() << " ";
|
||||
ss << err;
|
||||
driver.error(@0, ss.str());
|
||||
YYERROR;
|
||||
}
|
||||
param.pop_back();
|
||||
|
||||
std::string f;
|
||||
while (param.size() > 0) {
|
||||
f = param.back() + " " + f;
|
||||
param.pop_back();
|
||||
}
|
||||
|
||||
std::string file = modsecurity::utils::find_resource(f,
|
||||
driver.ref.back(), &err);
|
||||
if (file.empty()) {
|
||||
std::stringstream ss;
|
||||
ss << "Failed to load locate the unicode map file from: " << $1 << " ";
|
||||
ss << "Failed to locate the unicode map file from: " << f << " ";
|
||||
ss << err;
|
||||
driver.error(@0, ss.str());
|
||||
YYERROR;
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -774,7 +774,7 @@ EQUALS_MINUS (?i:=\-)
|
||||
{CONFIG_DIR_RULE_ENG} { return p::make_CONFIG_DIR_RULE_ENG(yytext, *driver.loc.back()); }
|
||||
{CONFIG_DIR_SEC_MARKER}[ \t]+["]{NEW_LINE_FREE_TEXT}["] { return p::make_CONFIG_DIR_SEC_MARKER(strchr(yytext, ' ') + 1, *driver.loc.back()); }
|
||||
{CONFIG_DIR_SEC_MARKER}[ \t]+{NEW_LINE_FREE_TEXT} { return p::make_CONFIG_DIR_SEC_MARKER(strchr(yytext, ' ') + 1, *driver.loc.back()); }
|
||||
{CONFIG_DIR_UNICODE_MAP_FILE}[ ]{FREE_TEXT_NEW_LINE} { return p::make_CONFIG_DIR_UNICODE_MAP_FILE(strchr(yytext, ' ') + 1, *driver.loc.back()); }
|
||||
{CONFIG_DIR_UNICODE_MAP_FILE}[ ]+{FREE_TEXT_NEW_LINE}[ ]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_UNICODE_MAP_FILE(strchr(yytext, ' ') + 1, *driver.loc.back()); }
|
||||
{CONFIG_DIR_UNICODE_CODE_PAGE}[ ]{FREE_TEXT_NEW_LINE} { return p::make_CONFIG_DIR_UNICODE_CODE_PAGE(strchr(yytext, ' ') + 1, *driver.loc.back()); }
|
||||
{CONFIG_SEC_REMOVE_RULES_BY_ID}[ ]+{FREE_TEXT_NEW_LINE} { return p::make_CONFIG_SEC_RULE_REMOVE_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); }
|
||||
{CONFIG_SEC_REMOVE_RULES_BY_MSG}[ \t]+{FREE_TEXT_NEW_LINE} { return p::make_CONFIG_SEC_RULE_REMOVE_BY_MSG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); }
|
||||
|
Reference in New Issue
Block a user