qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Vlad Lungu <vlad.lungu@windriver.com>, qemu-devel@nongnu.org
Cc: ehabkost@redhat.com, rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCHv2] multiboot: copy the cmdline verbatim, unescape module strings
Date: Thu, 15 Dec 2016 11:56:00 +0100	[thread overview]
Message-ID: <eee151e4-7cb6-eb26-a125-65757ec84e2e@redhat.com> (raw)
In-Reply-To: <1481796182-12670-1-git-send-email-vlad.lungu@windriver.com>



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	other threads:[~2016-12-15 10:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-15 10:03 [Qemu-devel] [PATCHv2] multiboot: copy the cmdline verbatim, unescape module strings Vlad Lungu
2016-12-15 10:56 ` Paolo Bonzini [this message]
2016-12-15 11:34   ` Vlad Lungu
2016-12-15 12:29     ` Paolo Bonzini
2016-12-15 12:31       ` Vlad Lungu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eee151e4-7cb6-eb26-a125-65757ec84e2e@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=vlad.lungu@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).