[master] 9d1b135 Fixups from 'Fix PROXY and HTTP/1 proto dissectors'
Martin Blix Grydeland
martin at varnish-software.com
Mon Jun 11 13:25:13 UTC 2018
commit 9d1b135dd5c33796fb675f1e046f6b87c284dfc8
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date: Mon Jun 11 14:33:26 2018 +0200
Fixups from 'Fix PROXY and HTTP/1 proto dissectors'
Remove old and now invalid assert.
Change order of evaluation in if-statement to make sure we don't step
outside rxbuf_e.
diff --git a/bin/varnishd/proxy/cache_proxy_proto.c b/bin/varnishd/proxy/cache_proxy_proto.c
index a10756d..fc4c451 100644
--- a/bin/varnishd/proxy/cache_proxy_proto.c
+++ b/bin/varnishd/proxy/cache_proxy_proto.c
@@ -76,7 +76,7 @@ vpx_proto1(const struct worker *wrk, const struct req *req)
*q++ = '\0';
/* Nuke the CRLF */
- if (*q != '\n' || q == req->htc->rxbuf_e)
+ if (q == req->htc->rxbuf_e || *q != '\n')
return (-1);
*q++ = '\0';
@@ -515,7 +515,6 @@ vpx_complete(struct http_conn *htc)
if (j == 0)
return (HTC_S_JUNK);
if (j == 1 && i == sizeof vpx1_sig) {
- assert (htc->rxbuf_e < htc->ws->r);
q = memchr(p + i, '\n', htc->rxbuf_e - (p + i));
if (q != NULL && (q - htc->rxbuf_b) > 107)
return (HTC_S_OVERFLOW);
More information about the varnish-commit
mailing list