mirror of
https://github.com/openssl/openssl.git
synced 2025-03-13 19:47:47 +08:00
Fix coverity-993406
Coverity flagged an overflow warning in the cmsapitest. Its pretty insignificant, but if a huge file is passed in via BIO, its possible for the length variable returned to overflow. Just check it as we read to silence coverity on it. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> (Merged from https://github.com/openssl/openssl/pull/24995)
This commit is contained in:
parent
bc43158797
commit
31cd9cd830
@ -332,6 +332,9 @@ static unsigned char *read_all(BIO *bio, long *p_len)
|
||||
if (ret < 0)
|
||||
break;
|
||||
|
||||
if (LONG_MAX - ret < *p_len)
|
||||
break;
|
||||
|
||||
*p_len += ret;
|
||||
|
||||
if (ret < step)
|
||||
|
Loading…
x
Reference in New Issue
Block a user