mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +03:00
Add extra debug info for pcre jit
This commit is contained in:
parent
1c0ed192db
commit
3cb5edde27
@ -503,6 +503,7 @@ static int msre_op_rx_param_init(msre_rule *rule, char **error_msg) {
|
||||
int erroffset;
|
||||
msc_regex_t *regex;
|
||||
const char *pattern = rule->op_param;
|
||||
int rc, jit;
|
||||
|
||||
if (error_msg == NULL) return -1;
|
||||
*error_msg = NULL;
|
||||
@ -516,6 +517,17 @@ static int msre_op_rx_param_init(msre_rule *rule, char **error_msg) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
rc = msc_fullinfo(regex, PCRE_INFO_JIT, &jit);
|
||||
if ((rc != 0) || (jit != 1)) {
|
||||
*error_msg = apr_psprintf(rule->ruleset->mp,
|
||||
"Rule %pp [id \"%s\"][file \"%s\"][line \"%d\"] - "
|
||||
"Execution error - "
|
||||
"Does not support JIT (%d)",
|
||||
rule,((rule->actionset != NULL)&&(rule->actionset->id != NULL)) ? rule->actionset->id : "-",
|
||||
rule->filename != NULL ? rule->filename : "-",
|
||||
rule->line_num,rc);
|
||||
}
|
||||
|
||||
rule->op_param_data = regex;
|
||||
} else {
|
||||
rule->re_precomp = 1;
|
||||
@ -538,7 +550,7 @@ static int msre_op_rx_execute(modsec_rec *msr, msre_rule *rule, msre_var *var, c
|
||||
int capture = 0;
|
||||
int matched_bytes = 0;
|
||||
int matched = 0;
|
||||
int rc;
|
||||
int rc, jit;
|
||||
char *qspos = NULL;
|
||||
const char *parm = NULL, *pattern = NULL;
|
||||
msc_parm *mparm = NULL;
|
||||
@ -574,6 +586,21 @@ static int msre_op_rx_execute(modsec_rec *msr, msre_rule *rule, msre_var *var, c
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (msr->txcfg->debuglog_level >= 4) {
|
||||
rc = msc_fullinfo(regex, PCRE_INFO_JIT, &jit);
|
||||
if ((rc != 0) || (jit != 1)) {
|
||||
*error_msg = apr_psprintf(rule->ruleset->mp,
|
||||
"Rule %pp [id \"%s\"][file \"%s\"][line \"%d\"] - "
|
||||
"Execution error - "
|
||||
"Does not support JIT (%d)",
|
||||
rule,((rule->actionset != NULL)&&(rule->actionset->id != NULL)) ? rule->actionset->id : "-",
|
||||
rule->filename != NULL ? rule->filename : "-",
|
||||
rule->line_num,rc);
|
||||
msr_log(msr, 4, "%s.", *error_msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user