qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] multiboot: copy the cmdline verbatim


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] multiboot: copy the cmdline verbatim
Date: Wed, 14 Dec 2016 17:55:07 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1


On 14/12/2016 17:19, Vlad Lungu wrote:
> get_opt_value() truncates the value at the first comma.
> Use memcpy() instead.

Looks good since get_opt_value is already used by the caller.  Have you
tested this with multiple initrd modules too?

Paolo

> Signed-off-by: Vlad Lungu <address@hidden>
> ---
>  hw/i386/multiboot.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c
> index 387caa6..b4495ad 100644
> --- a/hw/i386/multiboot.c
> +++ b/hw/i386/multiboot.c
> @@ -109,7 +109,7 @@ static uint32_t mb_add_cmdline(MultibootState *s, const 
> char *cmdline)
>      hwaddr p = s->offset_cmdlines;
>      char *b = (char *)s->mb_buf + p;
>  
> -    get_opt_value(b, strlen(cmdline) + 1, cmdline);
> +    memcpy(b, cmdline, strlen(cmdline) + 1);
>      s->offset_cmdlines += strlen(b) + 1;
>      return s->mb_buf_phys + p;
>  }
> 



reply via email to

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