diff --git a/apache2/apache2_io.c b/apache2/apache2_io.c index 74a7a7cd..9007f9d5 100644 --- a/apache2/apache2_io.c +++ b/apache2/apache2_io.c @@ -283,7 +283,9 @@ apr_status_t read_request_body(modsec_rec *msr, char **error_msg) { } if (msr->txcfg->stream_inbody_inspection == 1) { - modsecurity_request_body_to_stream(msr, buf, buflen, error_msg); + if (modsecurity_request_body_to_stream(msr, buf, buflen, error_msg) < 0) { + return -1; + } } msr->reqbody_length += buflen; diff --git a/apache2/msc_reqbody.c b/apache2/msc_reqbody.c index 5327e1e2..77755a9e 100644 --- a/apache2/msc_reqbody.c +++ b/apache2/msc_reqbody.c @@ -432,7 +432,7 @@ apr_status_t modsecurity_request_body_to_stream(modsec_rec *msr, const char *buf char* allocated = NULL; if (msr->stream_input_data == NULL) { - // Is the request body length is known beforehand? (requests that are not Transfer-Encoding: chunked) + // Is the request body length known beforehand? (requests that are not Transfer-Encoding: chunked) if (msr->request_content_length > 0) { // Use min of Content-Length and SecRequestBodyLimit allocate_length = min(msr->request_content_length, msr->txcfg->reqbody_limit);