From f91b82e688e7a9f2b843a121748d4b5b4f1180b6 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 23 Sep 2019 11:04:13 +0200 Subject: [PATCH] http2: A value is being subtracted from the unsigned variable PVS-Studio warning Fixes #4402 --- lib/http2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/http2.c b/lib/http2.c index b33782cc3..1481d1425 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -1775,8 +1775,9 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex, field list. */ #define AUTHORITY_DST_IDX 3 +/* USHRT_MAX is 65535 == 0xffff */ #define HEADER_OVERFLOW(x) \ - (x.namelen > (uint16_t)-1 || x.valuelen > (uint16_t)-1 - x.namelen) + (x.namelen > 0xffff || x.valuelen > 0xffff - x.namelen) /* * Check header memory for the token "trailers". -- 2.40.0