[prev in list] [next in list] [prev in thread] [next in thread] 

List:       varnish-commit
Subject:    [master] 48875ccde hpack: Check illegal header blanks with vct_issp()
From:       Dridi Boukelmoune <dridi.boukelmoune () gmail ! com>
Date:       2023-09-26 12:59:47
Message-ID: 20230926130206.95AFD1118B0 () lists ! varnish-cache ! org
[Download RAW message or body]


commit 48875ccde86969aed1641ec1b77ac2c2459203c9
Author: Walid Boudebouda <walid.boudebouda@gmail.com>
Date:   Fri Sep 8 17:25:06 2023 +0200

    hpack: Check illegal header blanks with vct_issp()
    
    Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>

diff --git a/bin/varnishd/http2/cache_http2_hpack.c b/bin/varnishd/http2/cache_http2_hpack.c
index cc33ec78c..35610b616 100644
--- a/bin/varnishd/http2/cache_http2_hpack.c
+++ b/bin/varnishd/http2/cache_http2_hpack.c
@@ -103,7 +103,7 @@ h2h_checkhdr(const struct http *hp, const char *b, size_t namelen, size_t len)
 	for (p = b + namelen; p < b + len; p++) {
 		switch(state) {
 		case FLD_VALUE_FIRST:
-			if (*p == ' ' || *p == 0x09) {
+			if (vct_issp(*p)) {
 				VSLb(hp->vsl, SLT_BogoHeader,
 				    "Illegal field value start %.*s",
 				    (int)(len > 20 ? 20 : len), b);
@@ -123,7 +123,7 @@ h2h_checkhdr(const struct http *hp, const char *b, size_t namelen, size_t len)
 			WRONG("http2 field value validation state");
 		}
 	}
-	if (state == FLD_VALUE && b[len - 1] <= 0x20) {
+	if (state == FLD_VALUE && vct_issp(b[len - 1])) {
 		VSLb(hp->vsl, SLT_BogoHeader,
 		    "Illegal field value (end) %.*s",
 		    (int)(len > 20 ? 20 : len), b);
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic