From: Guus Sliepen Date: Thu, 13 Oct 2016 14:45:37 +0000 (+0200) Subject: Allow non-empty lines after status code from a HTTP proxy. X-Git-Tag: release-1.0.30~10 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=30cc8541cca61368dc2c5de7452a8dd5456308d7;p=tinc Allow non-empty lines after status code from a HTTP proxy. --- diff --git a/src/proxy.c b/src/proxy.c index e30c1fb0..2b8f87c1 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -256,7 +256,12 @@ int receive_proxy_meta(connection_t *c, int start, int lenin) { char *p = memchr(c->buffer, '\n', c->buflen); if(!p || p - c->buffer >= c->buflen) return 0; - p = memchr(p + 1, '\n', c->buflen - (p + 1 - c->buffer)); + + while(p = memchr(p + 1, '\n', c->buflen - (p + 1 - c->buffer))) { + if(p[-1] == '\n') + break; + } + if(!p) return 0;