qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] linux-user: don't crash with null name


From: Riku Voipio
Subject: [Qemu-devel] [PATCH] linux-user: don't crash with null name
Date: Mon, 19 Jan 2009 17:29:34 +0200
User-agent: Mutt/1.5.11+cvs20060126

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 <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]