You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2005/10/10 12:45:40 UTC

svn commit: r312609 - /apr/apr/branches/0.9.x/threadproc/unix/proc.c

Author: trawick
Date: Mon Oct 10 03:45:37 2005
New Revision: 312609

URL: http://svn.apache.org/viewcvs?rev=312609&view=rev
Log:
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


Modified:
    apr/apr/branches/0.9.x/threadproc/unix/proc.c

Modified: apr/apr/branches/0.9.x/threadproc/unix/proc.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/threadproc/unix/proc.c?rev=312609&r1=312608&r2=312609&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/threadproc/unix/proc.c (original)
+++ apr/apr/branches/0.9.x/threadproc/unix/proc.c Mon Oct 10 03:45:37 2005
@@ -292,6 +292,14 @@
                                           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;