]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix Coverity-1604641
authorNeil Horman <nhorman@openssl.org>
Tue, 23 Jul 2024 19:30:38 +0000 (15:30 -0400)
committerNeil Horman <nhorman@openssl.org>
Thu, 25 Jul 2024 18:23:39 +0000 (14:23 -0400)
commit86fd4c1df91e58d316c863b5160d18c0f80dc6ac
treea85110d97fc1d762d62010e8dc697bd87f307fa7
parent3c6e11495975a4eda4cc5886080afed6203711ac
Fix Coverity-1604641

Coverity flagged an overflow warning here that can occur if BIO_write
returns an error.

The overflow itself is a bit of a non-issue, but if BIO_write returns
< 0, then the return from i2a_ASN1_OBJECT will be some odd value
representing whatever the offset from the error code to the number of
bytes the dump may or may not have written (or some larger negative
error code if both fail.

So lets fix it.  Only do the dump if the BIO_write call returned 0 or
greaater.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
(Merged from https://github.com/openssl/openssl/pull/24976)
crypto/asn1/a_object.c