Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions apache2/mod_security2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1662,9 +1662,13 @@ static void register_hooks(apr_pool_t *mp) {
/* Add the MODSEC_2.x compatibility defines */
*(char **)apr_array_push(ap_server_config_defines) = apr_pstrdup(mp, "MODSEC_2.5");

/* Add the MODSEC_a.b define */
/* Add version, feature, and compile-mode ModSecurity defines. */
*(char **)apr_array_push(ap_server_config_defines) = apr_psprintf(mp, "MODSEC_%s.%s", MODSEC_VERSION_MAJOR, MODSEC_VERSION_MINOR);

*(char **)apr_array_push(ap_server_config_defines) = apr_pstrdup(mp, "MODSEC_AnalyseMultipartHeaders");
*(char **)apr_array_push(ap_server_config_defines) = apr_pstrdup(mp, "MODSEC_ARGS_COMBINED_SIZE_NONAME");
#ifndef WITH_PCRE
*(char **)apr_array_push(ap_server_config_defines) = apr_pstrdup(mp, "MODSEC_PCRE2");
#endif
#if (!defined(NO_MODSEC_API))
/* Export optional functions. */
APR_REGISTER_OPTIONAL_FN(modsec_register_tfn);
Expand Down
6 changes: 6 additions & 0 deletions apache2/msc_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -2261,6 +2261,12 @@ char *construct_single_var(modsec_rec *msr, char *name) {
msre_var *vx = NULL;
char *my_error_msg = NULL;

if (msr->msc_rule_mptmp == NULL) {
if (apr_pool_create(&msr->msc_rule_mptmp, msr->mp) != APR_SUCCESS) {
return NULL;
}
}

/* Extract variable name and its parameter from the script. */
varname = apr_pstrdup(msr->mp, name);
if (varname == NULL) return NULL;
Expand Down