mirror of
https://github.com/QuasarApp/openssl.git
synced 2025-04-28 10:44:38 +00:00
Simplify the overflow checks in WPACKET_allocate_bytes()
Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
parent
9bf85bf9c5
commit
6ae4f5e087
@ -16,10 +16,7 @@ int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
|
||||
if (pkt->subs == NULL || len == 0)
|
||||
return 0;
|
||||
|
||||
if (SIZE_MAX - pkt->written < len)
|
||||
return 0;
|
||||
|
||||
if (pkt->written + len > pkt->maxsize)
|
||||
if (pkt->maxsize - pkt->written < len)
|
||||
return 0;
|
||||
|
||||
if (pkt->buf->length - pkt->written < len) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user