Re: [Qemu-devel] [PATCHv2] multiboot: copy the cmdline verbatim, unescape module strings

2016-12-15 Thread Vlad Lungu
On 12/15/2016 02:29 PM, Paolo Bonzini wrote: > > On 15/12/2016 12:34, Vlad Lungu wrote: >> >> On 12/15/2016 12:56 PM, Paolo Bonzini wrote: >>> On 15/12/2016 11:03, Vlad Lungu wrote: if (initrd_filename) { -char *next_initrd, not_last; +char

Re: [Qemu-devel] [PATCHv2] multiboot: copy the cmdline verbatim, unescape module strings

2016-12-15 Thread Paolo Bonzini
On 15/12/2016 12:34, Vlad Lungu wrote: > > > On 12/15/2016 12:56 PM, Paolo Bonzini wrote: >> >> On 15/12/2016 11:03, Vlad Lungu wrote: >>> >>> if (initrd_filename) { >>> -char *next_initrd, not_last; >>> +char *next_initrd, not_last, tmpbuf[strlen(initrd_filename) + 1];

Re: [Qemu-devel] [PATCHv2] multiboot: copy the cmdline verbatim, unescape module strings

2016-12-15 Thread Vlad Lungu
On 12/15/2016 12:56 PM, Paolo Bonzini wrote: > > On 15/12/2016 11:03, Vlad Lungu wrote: >> >> if (initrd_filename) { >> -char *next_initrd, not_last; >> +char *next_initrd, not_last, tmpbuf[strlen(initrd_filename) + 1]; >> >> mbs.offset_mods = mbs.mb_buf_size;

Re: [Qemu-devel] [PATCHv2] multiboot: copy the cmdline verbatim, unescape module strings

2016-12-15 Thread Paolo Bonzini
On 15/12/2016 11:03, Vlad Lungu wrote: > > if (initrd_filename) { > -char *next_initrd, not_last; > +char *next_initrd, not_last, tmpbuf[strlen(initrd_filename) + 1]; > > mbs.offset_mods = mbs.mb_buf_size; > > @@ -299,22 +299,24 @@ int

[Qemu-devel] [PATCHv2] multiboot: copy the cmdline verbatim, unescape module strings

2016-12-15 Thread Vlad Lungu
get_opt_value() truncates the value at the first comma Use memcpy() instead Unescape the module filename and parameters with get_opt_value() before calling mb_add_cmdline() Signed-off-by: Vlad Lungu --- hw/i386/multiboot.c | 18 ++ 1 file changed, 10