Skip to contentSkip to conversation

[6480] linux-user: don't crash with null name

Qemu-devel Aurelien Jarno 1 participant 1 message Jan 30, 2009

lore
Share & tools
lore
#0 lore raw

Revision: 6480

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6480
Author:   aurel32
Date:     2009-01-30 19:48:07 +0000 (Fri, 30 Jan 2009)

Log Message:
-----------
linux-user: don't crash with null name

Quoted 1 line

From Thayne Harbaugh.

path() may be called with null string, don't bother trying to remap in that case.

Modified Paths:
--------------
trunk/linux-user/path.c

Modified: trunk/linux-user/path.c
===================================================================

linux-user/path.c +1 -1
@@ -152,7 +152,7 @@
 {
     /* 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;