qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user: don't crash with null name
@ 2009-01-19 15:29 Riku Voipio
  2009-01-30 19:51 ` Aurelien Jarno
  0 siblings, 1 reply; 2+ messages in thread
From: Riku Voipio @ 2009-01-19 15:29 UTC (permalink / raw)
  To: qemu-devel

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] linux-user: don't crash with null name
  2009-01-19 15:29 [Qemu-devel] [PATCH] linux-user: don't crash with null name Riku Voipio
@ 2009-01-30 19:51 ` Aurelien Jarno
  0 siblings, 0 replies; 2+ messages in thread
From: Aurelien Jarno @ 2009-01-30 19:51 UTC (permalink / raw)
  To: Riku Voipio; +Cc: qemu-devel

On Mon, Jan 19, 2009 at 05:29:34PM +0200, Riku Voipio wrote:
> 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>
> ---

Thanks, applied.

>  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
> 
> 
> 

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-30 19:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-19 15:29 [Qemu-devel] [PATCH] linux-user: don't crash with null name Riku Voipio
2009-01-30 19:51 ` Aurelien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).