]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix coverity-1604661
authorNeil Horman <nhorman@openssl.org>
Tue, 16 Jul 2024 15:38:33 +0000 (11:38 -0400)
committerTomas Mraz <tomas@openssl.org>
Thu, 18 Jul 2024 17:09:10 +0000 (19:09 +0200)
commit50066236eb3b31c93aaa935ca38f5cc1ec056696
treeaf44e9b7e10e6fa906874be6ce869bfc56740a8c
parent0b67643ade24286dddb0ce1b44a8a8c366e85ecb
Fix coverity-1604661

Coverity called out an error in asn1parse_main, indicating that the
for(;;) loop which repeatedly reads from a bio and updates the length
value num, may overflow said value prior to exiting the loop.

We could probably call this a false positive, but on very large PEM
file, I suppose it could happen, so just add a check to ensure that num
doesn't go from a large positive to a large negative value inside the
loop

Fixes openssl/private#571

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24910)
apps/asn1parse.c