Skip to content

Commit 7fff893

Browse files
allanrboFelipe Zimmerle
authored and
Felipe Zimmerle
committed
Check return value of modsecurity_request_body_store
1 parent 6ce7f4d commit 7fff893

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

apache2/apache2_io.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ apr_status_t read_request_body(modsec_rec *msr, char **error_msg) {
283283
}
284284

285285
if (msr->txcfg->stream_inbody_inspection == 1) {
286-
modsecurity_request_body_to_stream(msr, buf, buflen, error_msg);
286+
if (modsecurity_request_body_to_stream(msr, buf, buflen, error_msg) < 0) {
287+
return -1;
288+
}
287289
}
288290

289291
msr->reqbody_length += buflen;

apache2/msc_reqbody.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ apr_status_t modsecurity_request_body_to_stream(modsec_rec *msr, const char *buf
432432
char* allocated = NULL;
433433

434434
if (msr->stream_input_data == NULL) {
435-
// Is the request body length is known beforehand? (requests that are not Transfer-Encoding: chunked)
435+
// Is the request body length known beforehand? (requests that are not Transfer-Encoding: chunked)
436436
if (msr->request_content_length > 0) {
437437
// Use min of Content-Length and SecRequestBodyLimit
438438
allocate_length = min(msr->request_content_length, msr->txcfg->reqbody_limit);

0 commit comments

Comments
 (0)