Skip to contentSkip to conversation

879e45c72da1569e07fbbc6a1aa2a708ea796044 breakage

Qemu-devel malc 2 participants 2 messages Nov 21, 2012

lore
Share & tools
lore

malc

author
#0 lore raw

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:

qemu-sockets.c +0 -0
index cfed9c5..e7272c8 100644
@@ -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;
Signature · 1 line
mailto:[email protected]
#1 lore raw

Il 21/11/2012 08:14, malc ha scritto:

Quoted 28 lines

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:

qemu-sockets.c +4 -2
index cfed9c5..e7272c8 100644
@@ -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")) {
Quoted 2 lines
         addr->ipv4 = addr->has_ipv4 = true;

Anthony Perard already submitted this patch, but it missed the -rc0 boat for some reason.

Paolo