[master] f5ada80b6 Fix a case I overlooked in the recent change to remove the NUL termination of the rxbuf.

Poul-Henning Kamp phk at FreeBSD.org
Thu Jun 14 07:49:12 UTC 2018


commit f5ada80b6c603adc253c5fe2605e72803ada7d54
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Jun 14 07:47:58 2018 +0000

    Fix a case I overlooked in the recent change to remove the NUL
    termination of the rxbuf.
    
    Found by:       fgs

diff --git a/bin/varnishd/http1/cache_http1_proto.c b/bin/varnishd/http1/cache_http1_proto.c
index d1ad4d28e..ac1a2a86e 100644
--- a/bin/varnishd/http1/cache_http1_proto.c
+++ b/bin/varnishd/http1/cache_http1_proto.c
@@ -73,7 +73,7 @@ HTTP1_Complete(struct http_conn *htc)
 	assert(htc->rxbuf_e <= htc->ws->r);
 
 	/* Skip any leading white space */
-	for (p = htc->rxbuf_b ; vct_islws(*p); p++)
+	for (p = htc->rxbuf_b ; p < htc->rxbuf_e && vct_islws(*p); p++)
 		continue;
 	if (p == htc->rxbuf_e)
 		return (HTC_S_EMPTY);


More information about the varnish-commit mailing list