diff options
author | Jeff Trawick <trawick@apache.org> | 2005-10-10 10:44:24 +0000 |
---|---|---|
committer | Jeff Trawick <trawick@apache.org> | 2005-10-10 10:44:24 +0000 |
commit | d0a461d2578923bd83c2ac78d1314e81652feb8f (patch) | |
tree | 3ab2995f8395f62a42bb550f606a5c6c40ed5823 /threadproc/unix/proc.c | |
parent | e479d77a3b021b39d7cb08afa4de3c525b3287e6 (diff) | |
download | apr-d0a461d2578923bd83c2ac78d1314e81652feb8f.tar.gz apr-d0a461d2578923bd83c2ac78d1314e81652feb8f.zip |
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: https://svn.apache.org/repos/asf/apr/apr/trunk@312607 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc/unix/proc.c')
-rw-r--r-- | threadproc/unix/proc.c | 8 |
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; |