From: Guus Sliepen Date: Fri, 14 Oct 2016 12:27:19 +0000 (+0200) Subject: Fix proxy reply parsing broken by the previous commit. X-Git-Tag: release-1.0.30~9 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=57bbc06733b973fb0ed8ba226f9159de870768b2;p=tinc Fix proxy reply parsing broken by the previous commit. --- diff --git a/src/proxy.c b/src/proxy.c index 2b8f87c1..22d49471 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -257,8 +257,8 @@ int receive_proxy_meta(connection_t *c, int start, int lenin) { if(!p || p - c->buffer >= c->buflen) return 0; - while(p = memchr(p + 1, '\n', c->buflen - (p + 1 - c->buffer))) { - if(p[-1] == '\n') + while((p = memchr(p + 1, '\n', c->buflen - (p + 1 - c->buffer)))) { + if(p > c->buffer + 3 && !memcmp(p - 3, "\r\n\r\n", 4)) break; }