Skip to content

Commit 7575eae

Browse files
author
Marc Stern
committed
Check return code of apr_procattr_io_set()
1 parent b3b33c9 commit 7575eae

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)