From: aurel32 Date: Fri, 30 Jan 2009 19:48:07 +0000 (+0000) Subject: linux-user: don't crash with null name X-Git-Tag: xen-3.4.0-rc2~69^2~39 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a516e72d60803cac3b81b3330db55983b080d8da;p=qemu-xen-4.0-testing.git linux-user: don't crash with null name From Thayne Harbaugh. path() may be called with null string, don't bother trying to remap in that case. Signed-off-by: Riku Voipio Signed-off-by: Aurelien Jarno git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6480 c046a42c-6fe2-441c-8c8c-71466251a162 --- diff --git a/linux-user/path.c b/linux-user/path.c index 27c7d505..06b1f5fb 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;