diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-09-23 11:04:13 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-09-23 11:04:13 +0200 |
commit | 722b6bdcef3cd6b47d248974b8ac8d6ade4fa0be (patch) | |
tree | d739a03eb8c43b2507f45ebe4fa2379e862767db | |
parent | 539b2c4b531a25933ab90ef06050c3042946bed2 (diff) | |
download | curl-722b6bdcef3cd6b47d248974b8ac8d6ade4fa0be.tar.gz |
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 47583265d..57f1b951b 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". |