From: Markus Armbruster <armbru@redhat.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
QEMU-devel <qemu-devel@nongnu.org>,
Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] qemu-sockets: Fix parsing of the inet option 'to'.
Date: Fri, 09 Nov 2012 11:44:45 +0100 [thread overview]
Message-ID: <877gpvukbm.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <1352387501-21907-1-git-send-email-anthony.perard@citrix.com> (Anthony PERARD's message of "Thu, 8 Nov 2012 15:11:41 +0000")
Anthony PERARD <anthony.perard@citrix.com> writes:
> Having a qemu command line argument like "-vnc 127.0.0.1:0,to=99" is broken.
> This have been break with commit 879e45c72da1569e07fbbc6a1aa2a708ea796044.
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
>
> ---
> qemu-sockets.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/qemu-sockets.c b/qemu-sockets.c
> index abcd791..11d3d32 100644
> --- a/qemu-sockets.c
> +++ b/qemu-sockets.c
> @@ -551,8 +551,9 @@ static InetSocketAddress *inet_parse(const char *str, Error **errp)
> optstr = str + pos;
> h = strstr(optstr, ",to=");
> if (h) {
> - if (1 != sscanf(str, "%d%n", &to, &pos) ||
> - (str[pos] != '\0' && str[pos] != ',')) {
> + h += 4;
> + if (1 != sscanf(h, "%d%n", &to, &pos) ||
> + (h[pos] != '\0' && h[pos] != ',')) {
Since you're touching this line anyway, consider cleaning up the Yoda
comparison to sscanf(...) != 1
> error_setg(errp, "error parsing to= argument");
> goto fail;
> }
next prev parent reply other threads:[~2012-11-09 10:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-08 15:11 [Qemu-devel] [PATCH] qemu-sockets: Fix parsing of the inet option 'to' Anthony PERARD
2012-11-09 2:54 ` Lei Li
2012-11-09 8:09 ` [Qemu-trivial] " Paolo Bonzini
2012-11-09 8:09 ` [Qemu-devel] " Paolo Bonzini
2012-11-09 10:44 ` Markus Armbruster [this message]
2012-11-09 11:36 ` Anthony PERARD
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=877gpvukbm.fsf@blackfin.pond.sub.org \
--to=armbru@redhat.com \
--cc=anthony.perard@citrix.com \
--cc=lcapitulino@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.