diff --git a/CHANGES b/CHANGES index 15ea1c2f..f5893a89 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ DD mmm YYYY - 2.9.x (to be released) ------------------- + * Check return code of apr_procattr_io_set() + [Issue #2958 - @marcstern] * Do not escape special chars in rx pattern with macro [Issue #2357 - @marcstern, @martinhsv] * Substitute two equals-equals operators in build diff --git a/apache2/apache2_util.c b/apache2/apache2_util.c index cdae2b58..d76da755 100644 --- a/apache2/apache2_util.c +++ b/apache2/apache2_util.c @@ -99,7 +99,12 @@ int apache2_exec(modsec_rec *msr, const char *command, const char **argv, char * return -1; } - apr_procattr_io_set(procattr, APR_NO_PIPE, APR_FULL_BLOCK, APR_NO_PIPE); + rc = apr_procattr_io_set(procattr, APR_NO_PIPE, APR_FULL_BLOCK, APR_NO_PIPE); + if (rc != APR_SUCCESS) { + msr_log(msr, 1, "Exec: apr_procattr_io_set failed: %d (%s)", rc, get_apr_error(r->pool, rc)); + return -1; + } + apr_procattr_cmdtype_set(procattr, APR_SHELLCMD); if (msr->txcfg->debuglog_level >= 9) {