From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LOw4N-0006hS-UO for qemu-devel@nongnu.org; Mon, 19 Jan 2009 10:29:43 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LOw4N-0006gt-4H for qemu-devel@nongnu.org; Mon, 19 Jan 2009 10:29:43 -0500 Received: from [199.232.76.173] (port=54922 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LOw4M-0006gh-Od for qemu-devel@nongnu.org; Mon, 19 Jan 2009 10:29:42 -0500 Received: from [84.20.150.76] (port=44513 helo=narury.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LOw4M-0006Tz-Cq for qemu-devel@nongnu.org; Mon, 19 Jan 2009 10:29:42 -0500 Received: from kos.to (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by narury.org (Postfix) with ESMTP id E2F723274001 for ; Mon, 19 Jan 2009 17:29:34 +0200 (EET) Date: Mon, 19 Jan 2009 17:29:34 +0200 From: Riku Voipio Message-ID: <20090119152934.GA20861@kos.to> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] linux-user: don't crash with null name Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 --- 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