Skip to content
Open
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
9 changes: 8 additions & 1 deletion apache2/msc_reqbody.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,22 @@ apr_status_t modsecurity_request_body_start(modsec_rec *msr, char **error_msg) {
assert(msr != NULL);
assert(error_msg != NULL);
*error_msg = NULL;
apr_status_t rc;
msr->msc_reqbody_length = 0;
msr->stream_input_length = 0;

/* Create a separate memory pool that will be used
* to allocate structures from (not data, which is allocated
* via malloc).
*/
apr_pool_create(&msr->msc_reqbody_mp, NULL);
rc = apr_pool_create(&msr->msc_reqbody_mp, NULL);
if (rc != APR_SUCCESS) {
*error_msg = apr_psprintf(msr->mp, "Input filter: Failed to create memory pool for request body: %s",
get_apr_error(msr->mp, rc));
return -1;
}

apr_pool_abort_set(apr_pool_abort_get(msr->mp), msr->msc_reqbody_mp);
/* Initialise request body processors, if any. */

if (msr->msc_reqbody_processor != NULL) {
Expand Down