From 8c4b8cbc65f06e483ee9c80f17cbddab42a590cb Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 8 Mar 1999 12:41:21 +0000 Subject: 1999-03-08 Roland McGrath * hurd/hurdexec.c (_hurd_exec): Handle ARGV or ENVP parameters being null, in which case send an empty string. --- hurd/hurdexec.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'hurd') 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; -- cgit v1.1