[6.0] 404003e91 Fix a case I overlooked in the recent change to remove the NUL termination of the rxbuf.

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


commit 404003e91de67395f08c727df99fe479d0a73b11
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