[master] a9af555 Fix the pseudo header lengths

Poul-Henning Kamp phk at FreeBSD.org
Mon Sep 5 09:09:09 CEST 2016


commit a9af55506fbac9d17ea2428f26f22b71fcfc4022
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Sep 5 07:00:03 2016 +0000

    Fix the pseudo header lengths

diff --git a/bin/varnishd/http2/cache_http2_hpack.c b/bin/varnishd/http2/cache_http2_hpack.c
index a1470d7..3626327 100644
--- a/bin/varnishd/http2/cache_http2_hpack.c
+++ b/bin/varnishd/http2/cache_http2_hpack.c
@@ -115,9 +115,11 @@ h2h_addhdr(struct http *hp, char *b, size_t namelen, size_t len)
 			   "http" or "https"). For now set it as a normal
 			   header, stripping the first ':'. */
 			b++;
+			len-=1;
 			n = hp->nhd;
 		} else if (!strncmp(b, ":authority: ", namelen)) {
 			b+=6;
+			len-=6;
 			memcpy(b, "host", 4);
 			n = hp->nhd;
 		} else {



More information about the varnish-commit mailing list