]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: peers: Fix peers data decoding issue
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 19 Jul 2016 12:04:36 +0000 (14:04 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 26 Jul 2016 12:37:38 +0000 (14:37 +0200)
This error led to truncated data after decoding upon receipt.
It's specific to peers v2 and needs to be backported to 1.6.

src/peers.c

index bf22b9344292c69ff7cf54c505200be47849a072..a8066c53ee4395beef854f566cbd420a9712c98e 100644 (file)
@@ -225,7 +225,7 @@ uint64_t intdecode(char **str, char *end) {
                }
                i += (uint64_t)msg[idx] <<  (4 + 7*(idx-1));
        }
-       while (msg[idx] > 128);
+       while (msg[idx] >= 128);
        *str = (char *)&msg[idx+1];
        return i;
 }