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:44:28 UTC

svn commit: r312607 - /apr/apr/trunk/threadproc/unix/proc.c

Author: trawick
Date: Mon Oct 10 03:44:24 2005
New Revision: 312607

URL: http://svn.apache.org/viewcvs?rev=312607&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/trunk/threadproc/unix/proc.c

Modified: apr/apr/trunk/threadproc/unix/proc.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/threadproc/unix/proc.c?rev=312607&r1=312606&r2=312607&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/unix/proc.c (original)
+++ apr/apr/trunk/threadproc/unix/proc.c Mon Oct 10 03:44:24 2005
@@ -326,6 +326,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;