qemu-devel
[Top][All Lists]
Advanced

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

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


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH] linux-user: don't crash with null name
Date: Fri, 30 Jan 2009 20:51:41 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

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

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
address@hidden                 http://www.aurel32.net




reply via email to

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