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 13:29:48 +0100 [thread overview]
Message-ID: <ff53b6f1-a373-a4ff-6144-a171151147b2@redhat.com> (raw)
In-Reply-To: <8a50b7ac-84cf-1111-0361-b9541fa4e174@windriver.com>
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];
>>>
>>> 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?
Yes, thanks!
Paolo
next prev parent reply other threads:[~2016-12-15 12:30 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
2016-12-15 11:34 ` Vlad Lungu
2016-12-15 12:29 ` Paolo Bonzini [this message]
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=ff53b6f1-a373-a4ff-6144-a171151147b2@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).