qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] win32: boot broken when bind & data dir are the same


From: Paolo Bonzini
Subject: Re: [PATCH] win32: boot broken when bind & data dir are the same
Date: Mon, 26 Oct 2020 08:57:37 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1

On 24/10/20 11:14, Sunil Muthuswamy wrote:
> With upstream commit#ea1edcd7da1a "vl: relocate paths to data
> directories", the data dir logic was unified between POSIX &
> Win32. That patch moved to using 'get_relocated_path()', to
> find the data dir. There is a latent bug in get_relocated_path
> which can cause it to spin indefinitely, when the bind dir is
> the same as the passed in dir (in this case, it was the data
> dir).
> 
> Signed-off-by: Sunil Muthuswamy <sunilmut@microsoft.com>
> ---
>  util/cutils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/util/cutils.c b/util/cutils.c
> index be4e43a9ef..c395974fab 100644
> --- a/util/cutils.c
> +++ b/util/cutils.c
> @@ -949,7 +949,7 @@ char *get_relocated_path(const char *dir)
>          bindir += len_bindir;
>          dir = next_component(dir, &len_dir);
>          bindir = next_component(bindir, &len_bindir);
> -    } while (len_dir == len_bindir && !memcmp(dir, bindir, len_dir));
> +    } while (len_dir && len_dir == len_bindir && !memcmp(dir, bindir, 
> len_dir));
>  
>      /* Ascend from bindir to the common prefix with dir.  */
>      while (len_bindir) {
> 

Queued, thanks.

Paolo




reply via email to

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