Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LSzOx-0000GP-SM for qemu-devel@nongnu.org; Fri, 30 Jan 2009 14:51:43 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LSzOx-0000Fv-8N for qemu-devel@nongnu.org; Fri, 30 Jan 2009 14:51:43 -0500 Received: from [199.232.76.173] (port=53340 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LSzOw-0000Fq-Sz for qemu-devel@nongnu.org; Fri, 30 Jan 2009 14:51:42 -0500 Received: from hall.aurel32.net ([88.191.82.174]:57467) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LSzOw-0004Zs-E3 for qemu-devel@nongnu.org; Fri, 30 Jan 2009 14:51:42 -0500 Date: Fri, 30 Jan 2009 20:51:41 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] linux-user: don't crash with null name Message-ID: <20090130195141.GB25214@hall.aurel32.net> References: <20090119152934.GA20861@kos.to> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20090119152934.GA20861@kos.to> Sender: Aurelien Jarno Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Riku Voipio Cc: qemu-devel@nongnu.org On Mon, Jan 19, 2009 at 05:29:34PM +0200, Riku Voipio wrote: > path() may be called with null string, don't bother trying to > remap in that case. > > Also from Thayne Harbaugh > > Signed-off-by: Riku Voipio > --- Thanks, applied. > linux-user/path.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/linux-user/path.c b/linux-user/path.c > index 27c7d50..06b1f5f 100644 > --- a/linux-user/path.c > +++ b/linux-user/path.c > @@ -152,7 +152,7 @@ const char *path(const char *name) > { > /* Only do absolute paths: quick and dirty, but should mostly be OK. > Could do relative by tracking cwd. */ > - if (!base || name[0] != '/') > + if (!base || !name || name[0] != '/') > return name; > > return follow_path(base, name) ?: name; > -- > 1.5.6.5 > > > -- > "rm -rf" only sounds scary if you don't have backups > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net