Skip to content

Commit a8b7b26

Browse files
authored
Merge pull request #2958 from marcstern/v2/mst/rc_check
Check return code of apr_procattr_io_set()
2 parents 11f85b8 + 7575eae commit a8b7b26

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apache2/apache2_util.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@ int apache2_exec(modsec_rec *msr, const char *command, const char **argv, char *
9999
return -1;
100100
}
101101

102-
apr_procattr_io_set(procattr, APR_NO_PIPE, APR_FULL_BLOCK, APR_NO_PIPE);
102+
rc = apr_procattr_io_set(procattr, APR_NO_PIPE, APR_FULL_BLOCK, APR_NO_PIPE);
103+
if (rc != APR_SUCCESS) {
104+
msr_log(msr, 1, "Exec: apr_procattr_io_set failed: %d (%s)", rc, get_apr_error(r->pool, rc));
105+
return -1;
106+
}
107+
103108
apr_procattr_cmdtype_set(procattr, APR_SHELLCMD);
104109

105110
if (msr->txcfg->debuglog_level >= 9) {

0 commit comments

Comments
 (0)