mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Merge pull request #3375 from airween/v2/failjiterr
fix: add msc_fullinfo() to check JIT compilation
This commit is contained in:
commit
e0e732aaef
@ -37,6 +37,27 @@
|
||||
|
||||
#include "libinjection/libinjection.h"
|
||||
|
||||
#ifdef WITH_PCRE_STUDY
|
||||
#ifdef WITH_PCRE_JIT
|
||||
#ifdef WITH_PCRE2
|
||||
/**
|
||||
* @brief Set the JIT compile return code and JIT compile status.
|
||||
* \param regex regex structure
|
||||
* \param rc return code of the JIT compile
|
||||
* \param jit JIT compile status
|
||||
* \return void
|
||||
*/
|
||||
static void msc_op_set_jitrc(msc_regex_t *regex, int *rc, int *jit) {
|
||||
*rc = regex->jit_compile_rc;
|
||||
if (*rc == 0) {
|
||||
msc_fullinfo(regex, PCRE2_INFO_JITSIZE, jit);
|
||||
*jit = (*jit > 0) ? 1 : 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
*
|
||||
@ -724,7 +745,7 @@ static int msre_op_validateHash_param_init(msre_rule *rule, char **error_msg) {
|
||||
#ifdef WITH_PCRE_STUDY
|
||||
#ifdef WITH_PCRE_JIT
|
||||
#ifdef WITH_PCRE2
|
||||
rc = regex->jit_compile_rc;
|
||||
msc_op_set_jitrc(regex, &rc, &jit);
|
||||
#else
|
||||
rc = msc_fullinfo(regex, PCRE_INFO_JIT, &jit);
|
||||
#endif
|
||||
@ -830,7 +851,7 @@ static int msre_op_validateHash_execute(modsec_rec *msr, msre_rule *rule, msre_v
|
||||
#ifdef WITH_PCRE_JIT
|
||||
if (msr->txcfg->debuglog_level >= 4) {
|
||||
#ifdef WITH_PCRE2
|
||||
rc = regex->jit_compile_rc;
|
||||
msc_op_set_jitrc(regex, &rc, &jit);
|
||||
#else
|
||||
rc = msc_fullinfo(regex, PCRE_INFO_JIT, &jit);
|
||||
#endif
|
||||
@ -1001,7 +1022,7 @@ static int msre_op_rx_param_init(msre_rule *rule, char **error_msg) {
|
||||
#ifdef WITH_PCRE_STUDY
|
||||
#ifdef WITH_PCRE_JIT
|
||||
#ifdef WITH_PCRE2
|
||||
rc = regex->jit_compile_rc;
|
||||
msc_op_set_jitrc(regex, &rc, &jit);
|
||||
#else
|
||||
rc = msc_fullinfo(regex, PCRE_INFO_JIT, &jit);
|
||||
#endif
|
||||
@ -1099,7 +1120,7 @@ static int msre_op_rx_execute(modsec_rec *msr, msre_rule *rule, msre_var *var, c
|
||||
#ifdef WITH_PCRE_JIT
|
||||
if (msr->txcfg->debuglog_level >= 4) {
|
||||
#ifdef WITH_PCRE2
|
||||
rc = regex->jit_compile_rc;
|
||||
msc_op_set_jitrc(regex, &rc, &jit);
|
||||
#else
|
||||
rc = msc_fullinfo(regex, PCRE_INFO_JIT, &jit);
|
||||
#endif
|
||||
@ -2990,7 +3011,7 @@ static int msre_op_verifyCC_execute(modsec_rec *msr, msre_rule *rule, msre_var *
|
||||
#ifdef WITH_PCRE_JIT
|
||||
if (msr->txcfg->debuglog_level >= 4) {
|
||||
#ifdef WITH_PCRE2
|
||||
rc = regex->jit_compile_rc;
|
||||
msc_op_set_jitrc(regex, &rc, &jit);
|
||||
#else
|
||||
rc = msc_fullinfo(regex, PCRE_INFO_JIT, &jit);
|
||||
#endif
|
||||
@ -3329,7 +3350,7 @@ static int msre_op_verifyCPF_execute(modsec_rec *msr, msre_rule *rule, msre_var
|
||||
#ifdef WITH_PCRE_JIT
|
||||
if (msr->txcfg->debuglog_level >= 4) {
|
||||
#ifdef WITH_PCRE2
|
||||
rc = regex->jit_compile_rc;
|
||||
msc_op_set_jitrc(regex, &rc, &jit);
|
||||
#else
|
||||
rc = msc_fullinfo(regex, PCRE_INFO_JIT, &jit);
|
||||
#endif
|
||||
@ -3654,7 +3675,7 @@ static int msre_op_verifySSN_execute(modsec_rec *msr, msre_rule *rule, msre_var
|
||||
#ifdef WITH_PCRE_JIT
|
||||
if (msr->txcfg->debuglog_level >= 4) {
|
||||
#ifdef WITH_PCRE2
|
||||
rc = regex->jit_compile_rc;
|
||||
msc_op_set_jitrc(regex, &rc, &jit);
|
||||
#else
|
||||
rc = msc_fullinfo(regex, PCRE_INFO_JIT, &jit);
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user