From 56b3d9cd2d85ee8c6d0c3d012ae9b3f6ae1b3d25 Mon Sep 17 00:00:00 2001 From: Thomas Gschwantner Date: Tue, 8 Oct 2019 23:59:41 +0200 Subject: Fix parsing issue with split messages Previously this would trigger a BUG_ON() since the calculation of length & offset was wrong since we added the previous part of the buffer (req->buf) in parse_request(). This meant handle_request() couldn't know how much bytes where actually left in the buffer or their offset. --- wg-dynamic-client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'wg-dynamic-client.c') diff --git a/wg-dynamic-client.c b/wg-dynamic-client.c index e425a27..2edb413 100644 --- a/wg-dynamic-client.c +++ b/wg-dynamic-client.c @@ -68,7 +68,7 @@ static void check_signal() static int request_ip(struct wg_dynamic_request_ip *rip) { unsigned char buf[RECV_BUFSIZE + MAX_LINESIZE]; - size_t msglen, remaining, off = 0; + size_t msglen, remaining = 0, off = 0; struct sockaddr_in6 dstaddr = { .sin6_family = AF_INET6, .sin6_addr = well_known, -- cgit v1.2.3-59-g8ed1b