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.

Also, the second argument of get_opt_value can be sizeof(tmpbuf) or
ARRAY_SIZE(tmpbuf), as you prefer.

Paolo

Reply via email to