aboutsummaryrefslogtreecommitdiff
path: root/hurd/hurdexec.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1999-03-08 12:41:21 +0000
committerRoland McGrath <roland@gnu.org>1999-03-08 12:41:21 +0000
commit8c4b8cbc65f06e483ee9c80f17cbddab42a590cb (patch)
treef1afbc0f2fc8ef251e3cab85879d04999a846d33 /hurd/hurdexec.c
parentb93492aaddcd959f47419ca9b44bc2ecca97858b (diff)
downloadglibc-8c4b8cbc65f06e483ee9c80f17cbddab42a590cb.zip
glibc-8c4b8cbc65f06e483ee9c80f17cbddab42a590cb.tar.gz
glibc-8c4b8cbc65f06e483ee9c80f17cbddab42a590cb.tar.bz2
1999-03-08 Roland McGrath <roland@baalperazim.frob.com>
* hurd/hurdexec.c (_hurd_exec): Handle ARGV or ENVP parameters being null, in which case send an empty string.
Diffstat (limited to 'hurd/hurdexec.c')
-rw-r--r--hurd/hurdexec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/hurd/hurdexec.c b/hurd/hurdexec.c
index 83e4408..fa35ce7 100644
--- a/hurd/hurdexec.c
+++ b/hurd/hurdexec.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,94,95,96,97,99 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -49,8 +49,12 @@ _hurd_exec (task_t task, file_t file,
mach_port_t *please_dealloc, *pdp;
/* XXX needs to be hurdmalloc XXX */
- if (err = __argz_create (argv, &args, &argslen))
+ if (argv == NULL)
+ args = NULL, argslen = 0;
+ else if (err = __argz_create (argv, &args, &argslen))
return err;
+ if (envp == NULL)
+ env = NULL, envlen = 0;
if (err = __argz_create (envp, &env, &envlen))
goto outargs;