summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2005-10-10 10:45:37 +0000
committertrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2005-10-10 10:45:37 +0000
commit4f82f3c5d85e5c561100d25fc8d3a82d6b2d45d1 (patch)
tree89eab9fdc4b11804f48d5a92ad5fe6744824eaa8
parentbaca36ac27eba495905d6ae445b835636d431fcd (diff)
downloadlibapr-4f82f3c5d85e5c561100d25fc8d3a82d6b2d45d1.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/branches/0.9.x@312609 13f79535-47bb-0310-9956-ffa450edef68
-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 2ea75dd5f..aa9da0118 100644
--- a/threadproc/unix/proc.c
+++ b/threadproc/unix/proc.c
@@ -292,6 +292,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;