qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCHv2] multiboot: copy the cmdline verbatim, unescap


From: Vlad Lungu
Subject: Re: [Qemu-devel] [PATCHv2] multiboot: copy the cmdline verbatim, unescape module strings
Date: Thu, 15 Dec 2016 13:34:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0


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;
>>  
>> @@ -299,22 +299,24 @@ int load_multiboot(FWCfgState *fw_cfg,
>>              next_initrd = (char *)get_opt_value(NULL, 0, initrd_filename);
>>              not_last = *next_initrd;
>>              *next_initrd = '\0';
>> +            /* Unescape the filename + eventual arguments */
>> +            get_opt_value(tmpbuf, strlen(initrd_filename) + 1, 
>> initrd_filename);
> No need to call get_opt_value twice; you can call it once since you have
> declared tmpbuf to hold the entire size of initrd_filename.
So what you're saying is to go with

             next_initrd = (char *)get_opt_value(tmpbuf, sizeof(tmpbuf), 
initrd_filename);

and delete the second call to get_opt_value().

Is that right?

Regards,
Vlad




reply via email to

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