mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Merge pull request #3066 from owasp-modsecurity/revert-2946-v2/mst/issue610
Revert "Fix for https://github.com/SpiderLabs/ModSecurity/issues/610"
This commit is contained in:
commit
5c79cb0d84
@ -31,7 +31,11 @@ static apr_status_t msc_pcre_cleanup(msc_regex_t *regex) {
|
||||
}
|
||||
#else
|
||||
if (regex->pe != NULL) {
|
||||
#if defined(VERSION_NGINX)
|
||||
pcre_free(regex->pe);
|
||||
#else
|
||||
free(regex->pe);
|
||||
#endif
|
||||
regex->pe = NULL;
|
||||
}
|
||||
if (regex->re != NULL) {
|
||||
@ -148,15 +152,19 @@ void *msc_pregcomp_ex(apr_pool_t *pool, const char *pattern, int options,
|
||||
|
||||
#ifdef WITH_PCRE_STUDY
|
||||
#ifdef WITH_PCRE_JIT
|
||||
pe = pcre_study(regex->re, PCRE_STUDY_EXTRA_NEEDED|PCRE_STUDY_JIT_COMPILE, &errptr);
|
||||
pe = pcre_study(regex->re, PCRE_STUDY_JIT_COMPILE, &errptr);
|
||||
#else
|
||||
pe = pcre_study(regex->re, PCRE_STUDY_EXTRA_NEEDED, &errptr);
|
||||
pe = pcre_study(regex->re, 0, &errptr);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Setup the pcre_extra record if pcre_study did not already do it */
|
||||
if (pe == NULL) {
|
||||
pe = (pcre_extra*)pcre_malloc(sizeof(pcre_extra));
|
||||
#if defined(VERSION_NGINX)
|
||||
pe = pcre_malloc(sizeof(pcre_extra));
|
||||
#else
|
||||
pe = malloc(sizeof(pcre_extra));
|
||||
#endif
|
||||
if (pe == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user