[master] 1b7e1d6 Forgot this part of last commit.

Poul-Henning Kamp phk at FreeBSD.org
Sat Feb 25 22:57:05 CET 2017


commit 1b7e1d64ddd128c4e3dbb4a185a4a057653adbfc
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sat Feb 25 20:48:22 2017 +0000

    Forgot this part of last commit.

diff --git a/bin/varnishd/http2/cache_http2_hpack.c b/bin/varnishd/http2/cache_http2_hpack.c
index ea9a2b5..ef3496b 100644
--- a/bin/varnishd/http2/cache_http2_hpack.c
+++ b/bin/varnishd/http2/cache_http2_hpack.c
@@ -57,10 +57,17 @@ h2h_checkhdr(const struct http *hp, const char *b, size_t namelen, size_t len)
 			/* Check valid name characters */
 			if (p == b && *p == ':')
 				continue; /* pseudo-header */
-			if (vct_istchar(*p) && (!isupper(*p)))
+			if (isupper(*p)) {
+				VSLb(hp->vsl, SLT_BogoHeader,
+				    "Illegal header name (upper-case): %.*s",
+				    (int)(len > 20 ? 20 : len), b);
+				return (H2CE_PROTOCOL_ERROR);
+			}
+			if (vct_istchar(*p)) {
 				/* XXX: vct should have a proper class for
 				   this avoiding two checks */
 				continue;
+			}
 			VSLb(hp->vsl, SLT_BogoHeader,
 			    "Illegal header name: %.*s",
 			    (int)(len > 20 ? 20 : len), b);



More information about the varnish-commit mailing list