[master] 018c0fda4 SQUASHME: switch to vct_ishdrval()

Nils Goroll nils.goroll at uplex.de
Fri Oct 9 11:43:06 UTC 2020


commit 018c0fda4c62081f20f7309d02a37907d0f42ad5
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Sep 17 12:31:44 2020 +0200

    SQUASHME: switch to vct_ishdrval()

diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c
index f88daaac1..68597ad84 100644
--- a/bin/varnishd/cache/cache_vrt.c
+++ b/bin/varnishd/cache/cache_vrt.c
@@ -597,7 +597,7 @@ validhdr(const char *p)
 {
 	AN(p);
 	for(;*p != '\0'; p++)
-		if (vct_isctl(*p) && !vct_issp(*p))
+		if (! vct_ishdrval(*p))
 			return (0);
 	return (1);
 }
diff --git a/include/vct.h b/include/vct.h
index 7c5825849..92e4123b9 100644
--- a/include/vct.h
+++ b/include/vct.h
@@ -84,6 +84,7 @@ vct_is(int x, uint16_t y)
 #define vct_isxmlnamestart(x) vct_is(x, VCT_XMLNAMESTART)
 #define vct_isxmlname(x) vct_is(x, VCT_XMLNAMESTART | VCT_XMLNAME)
 #define vct_istchar(x) vct_is(x, VCT_ALPHA | VCT_DIGIT | VCT_TCHAR)
+#define vct_ishdrval(x) (((x) >= 0x20 && (x) != 0x7f) || (x) == 0x09)
 
 static inline int
 vct_iscrlf(const char* p, const char* end)


More information about the varnish-commit mailing list