[master] 325faac2c hpack: Remove redundant/incorrect header validation
Dridi Boukelmoune
dridi at varni.sh
Mon Nov 6 13:40:49 UTC 2023
On Tue, Sep 26, 2023 at 1:02 PM Dridi Boukelmoune
<dridi.boukelmoune at gmail.com> wrote:
>
>
> commit 325faac2cdfb2080f2ecccd340da49b1c41f7fe5
> Author: Walid Boudebouda <walid.boudebouda at gmail.com>
> Date: Fri Sep 8 17:13:19 2023 +0200
>
> hpack: Remove redundant/incorrect header validation
>
> Control characters will be caught by vct_ishdrval() anyways, but this
> condition would also reject allowed obs-text non-ASCII characters.
>
> Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
I'm responsible for the incorrect statement above. The macro that will
catch invalid characters for header field names is vct_istchar() actually.
Dridi
> diff --git a/bin/varnishd/http2/cache_http2_hpack.c b/bin/varnishd/http2/cache_http2_hpack.c
> index 92befad53..b5451eb22 100644
> --- a/bin/varnishd/http2/cache_http2_hpack.c
> +++ b/bin/varnishd/http2/cache_http2_hpack.c
> @@ -75,12 +75,6 @@ h2h_checkhdr(const struct http *hp, const char *b, size_t namelen, size_t len)
> break;
> /* FALL_THROUGH */
> case FLD_NAME:
> - if (*p <= 0x20 || *p >= 0x7f) {
> - VSLb(hp->vsl, SLT_BogoHeader,
> - "Illegal field header name (control): %.*s",
> - (int)(len > 20 ? 20 : len), b);
> - return (H2SE_PROTOCOL_ERROR);
> - }
> if (isupper(*p)) {
> VSLb(hp->vsl, SLT_BogoHeader,
> "Illegal field header name (upper-case): %.*s",
> _______________________________________________
> varnish-commit mailing list
> varnish-commit at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit
More information about the varnish-commit
mailing list