From: Roland McGrath Date: Mon, 8 Mar 1999 12:41:21 +0000 (+0000) Subject: 1999-03-08 Roland McGrath X-Git-Tag: cvs/libc-as-990315~19 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=8c4b8cbc65f06e483ee9c80f17cbddab42a590cb;p=glibc.git 1999-03-08 Roland McGrath * hurd/hurdexec.c (_hurd_exec): Handle ARGV or ENVP parameters being null, in which case send an empty string. --- diff --git a/hurd/hurdexec.c b/hurd/hurdexec.c index 83e44081f5..fa35ce7d1b 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;