summaryrefslogtreecommitdiff
path: root/threadproc
diff options
context:
space:
mode:
authortrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2005-10-10 10:44:24 +0000
committertrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2005-10-10 10:44:24 +0000
commitd9ca2d638cea93ceab358d34e573673778d53953 (patch)
tree3ab2995f8395f62a42bb550f606a5c6c40ed5823 /threadproc
parent6b57330aec1f9a1a8c0eb495baffb6f877bba73d (diff)
downloadlibapr-d9ca2d638cea93ceab358d34e573673778d53953.tar.gz
Don't pass NULL to execve() for the environment array,
resolving a theoretical problem with standards compliance and an actual problem with Purify. Reviewed by: Joe Orton git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@312607 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc')
-rw-r--r--threadproc/unix/proc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
index 5631e4c64..f7802a44c 100644
--- a/threadproc/unix/proc.c
+++ b/threadproc/unix/proc.c
@@ -326,6 +326,14 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
apr_pool_t *pool)
{
int i;
+ const char * const empty_envp[] = {NULL};
+
+ if (!env) { /* Specs require an empty array instead of NULL;
+ * Purify will trigger a failure, even if many
+ * implementations don't.
+ */
+ env = empty_envp;
+ }
new->in = attr->parent_in;
new->err = attr->parent_err;