linux-user: don't crash with null name
PATCH 1/1 linux-user: don't crash with null name
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 <[email protected]>
--- linux-user/path.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
linux-user/path.c +1 -1
@@ -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;
Signature · 5 lines
1.5.6.5 -- "rm -rf" only sounds scary if you don't have backups
Aurelien Jarno
AppliedQuoted 7 lines · Riku Voipio
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 <[email protected]>---
Thanks, applied.
Quoted 25 lines
linux-user/path.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)linux-user/path.c +1
-1@@ -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;Signature · 5 lines
1.5.6.5 -- "rm -rf" only sounds scary if you don't have backups
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net