[openssl] OpenSSL_1_1_1-stable update

Dr. Paul Dale pauli at openssl.org
Fri May 14 00:15:51 UTC 2021


The branch OpenSSL_1_1_1-stable has been updated
       via  a812f8fc8f3c9ba30e5ecd2c168cca0613f15dcd (commit)
      from  9a48d4a4fec6827d387ee63756504892e3656299 (commit)


- Log -----------------------------------------------------------------
commit a812f8fc8f3c9ba30e5ecd2c168cca0613f15dcd
Author: bonniegong <46280630+bonniegong at users.noreply.github.com>
Date:   Mon Apr 12 10:43:13 2021 +0800

    check i2d_ASN1_TYPE return value
    
    add a length check to the return value of function i2d_ASN1_TYPE. Return an error instead of trying to malloc a negative number.
    
    CLA: trivial
    
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    Reviewed-by: Paul Dale <pauli at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/14828)
    
    (cherry picked from commit c65abf2213117eb5348a46fbc18f706aca052e85)

-----------------------------------------------------------------------

Summary of changes:
 crypto/asn1/a_strex.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/crypto/asn1/a_strex.c b/crypto/asn1/a_strex.c
index 4879b33785..7cd18b4b85 100644
--- a/crypto/asn1/a_strex.c
+++ b/crypto/asn1/a_strex.c
@@ -280,6 +280,8 @@ static int do_dump(unsigned long lflags, char_io *io_ch, void *arg,
     t.type = str->type;
     t.value.ptr = (char *)str;
     der_len = i2d_ASN1_TYPE(&t, NULL);
+    if (der_len <= 0)
+        return -1;
     if ((der_buf = OPENSSL_malloc(der_len)) == NULL) {
         ASN1err(ASN1_F_DO_DUMP, ERR_R_MALLOC_FAILURE);
         return -1;


More information about the openssl-commits mailing list