From: Riku Voipio <riku.voipio@iki.fi>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] linux-user: don't crash with null name
Date: Mon, 19 Jan 2009 17:29:34 +0200 [thread overview]
Message-ID: <20090119152934.GA20861@kos.to> (raw)
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 <riku.voipio@iki.fi>
---
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
next reply other threads:[~2009-01-19 15:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-19 15:29 Riku Voipio [this message]
2009-01-30 19:51 ` [Qemu-devel] [PATCH] linux-user: don't crash with null name Aurelien Jarno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090119152934.GA20861@kos.to \
--to=riku.voipio@iki.fi \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.