From ebf735a5ced2d1a5fd1d6324617e61c20f742bf6 Mon Sep 17 00:00:00 2001 From: Katie Hockman Date: Wed, 28 Apr 2021 14:47:48 -0400 Subject: [PATCH] [PATCH] [release-branch.go1.15] std: update golang.org/x/net to 20210428183841-261fb518b1ed Steps: go get -d golang.org/x/net@release-branch.go1.15 go mod tidy go mod vendor This http2 bundle does not need to be updated. Fixes #45711 Change-Id: I085ca592dfc8d5d9c328a7979142e88e7130a813 Reviewed-on: https://go-review.googlesource.com/c/go/+/314790 Trust: Katie Hockman Run-TryBot: Katie Hockman Reviewed-by: Dmitri Shuralyov Gbp-Pq: Name 0007-CVE-2021-31525.patch --- src/vendor/golang.org/x/net/http/httpguts/httplex.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/vendor/golang.org/x/net/http/httpguts/httplex.go b/src/vendor/golang.org/x/net/http/httpguts/httplex.go index e7de24ee..c79aa73f 100644 --- a/src/vendor/golang.org/x/net/http/httpguts/httplex.go +++ b/src/vendor/golang.org/x/net/http/httpguts/httplex.go @@ -137,11 +137,13 @@ func trimOWS(x string) string { // contains token amongst its comma-separated tokens, ASCII // case-insensitively. func headerValueContainsToken(v string, token string) bool { - v = trimOWS(v) - if comma := strings.IndexByte(v, ','); comma != -1 { - return tokenEqual(trimOWS(v[:comma]), token) || headerValueContainsToken(v[comma+1:], token) + for comma := strings.IndexByte(v, ','); comma != -1; comma = strings.IndexByte(v, ',') { + if tokenEqual(trimOWS(v[:comma]), token) { + return true + } + v = v[comma+1:] } - return tokenEqual(v, token) + return tokenEqual(trimOWS(v), token) } // lowerASCII returns the ASCII lowercase version of b. -- 2.30.2