Skip to content
Open
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion apache2/msc_reqbody.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ apr_status_t modsecurity_request_body_start(modsec_rec *msr, char **error_msg) {
* via malloc).
*/
apr_pool_create(&msr->msc_reqbody_mp, NULL);

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

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apr_pool_create(&msr->msc_reqbody_mp, NULL); returns an apr_status_t, but the result isn’t checked before calling apr_pool_abort_set(...) (and later using msr->msc_reqbody_mp). If pool creation fails, this will immediately dereference a NULL pool. Capture the return code, and on failure set *error_msg and return an error before using msr->msc_reqbody_mp.

Copilot uses AI. Check for mistakes.

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