Allow non-empty lines after status code from a HTTP proxy.
authorGuus Sliepen <guus@tinc-vpn.org>
Thu, 13 Oct 2016 14:45:37 +0000 (16:45 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Thu, 13 Oct 2016 14:45:37 +0000 (16:45 +0200)
src/proxy.c

index e30c1fb01cbc5212ada0f05beaaa43e8a2685541..2b8f87c13e36dcc5d32e47968ae8f33b2c14ae3c 100644 (file)
@@ -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;