[openssl/openssl] 86fd4c: Fix Coverity-1604641

Neil Horman noreply at github.com
Thu Jul 25 18:36:58 UTC 2024


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: 86fd4c1df91e58d316c863b5160d18c0f80dc6ac
      https://github.com/openssl/openssl/commit/86fd4c1df91e58d316c863b5160d18c0f80dc6ac
  Author: Neil Horman <nhorman at openssl.org>
  Date:   2024-07-25 (Thu, 25 Jul 2024)

  Changed paths:
    M crypto/asn1/a_object.c

  Log Message:
  -----------
  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 at gmail.com>
Reviewed-by: Paul Yang <kaishen.yy at antfin.com>
(Merged from https://github.com/openssl/openssl/pull/24976)



To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications


More information about the openssl-commits mailing list