1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-05 09:05:04 -05:00

http2: A value is being subtracted from the unsigned variable

PVS-Studio warning
Fixes #4402
This commit is contained in:
Daniel Stenberg 2019-09-23 11:04:13 +02:00
parent 9aed993da0
commit f91b82e688
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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".