diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-09-23 11:04:13 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-09-23 22:44:02 +0200 |
commit | f91b82e688e7a9f2b843a121748d4b5b4f1180b6 (patch) | |
tree | a9b46f2a79eb6b720e984d40f6acc790e4ae1658 | |
parent | 9aed993da0e33e9aea27bfcd2ebcb9e7181d99c0 (diff) |
http2: A value is being subtracted from the unsigned variable
PVS-Studio warning
Fixes #4402
-rw-r--r-- | lib/http2.c | 3 |
1 files changed, 2 insertions, 1 deletions
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". |