qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] 879e45c72da1569e07fbbc6a1aa2a708ea796044 breakage
@ 2012-11-21  7:14 malc
  2012-11-21  7:50 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: malc @ 2012-11-21  7:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini


Commit in the subject broke inet parsing (noticed by a build on a remote
system without X and only internal vnc server that by default uses
localhost:0,to=99), following was probably intended, but you're never
sure:

diff --git a/qemu-sockets.c b/qemu-sockets.c
index cfed9c5..e7272c8 100644
--- a/qemu-sockets.c
+++ b/qemu-sockets.c
@@ -529,13 +529,15 @@ 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] != ',')) {
             error_setg(errp, "error parsing to= argument");
             goto fail;
         }
         addr->has_to = true;
         addr->to = to;
+        optstr = h + pos;
     }
     if (strstr(optstr, ",ipv4")) {
         addr->ipv4 = addr->has_ipv4 = true;

-- 
mailto:av1474@comtv.ru

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-21  7:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-21  7:14 [Qemu-devel] 879e45c72da1569e07fbbc6a1aa2a708ea796044 breakage malc
2012-11-21  7:50 ` Paolo Bonzini

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).