[6.0] 5601a4cc6 Fixups from 'Fix PROXY and HTTP/1 proto dissectors'

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Aug 16 08:53:11 UTC 2018


commit 5601a4cc63c6a92ca4fd76ac92359e619cd0cd84
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 a10756d24..fc4c451b3 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