[openssl-commits] [openssl] master update

Matt Caswell matt at openssl.org
Tue Jun 14 14:11:48 UTC 2016


The branch master has been updated
       via  036e61b1669fee477af2d5d1afd0b015517f7f9a (commit)
       via  d285b5418ee1ff361f06545e0489ece61bdd1a50 (commit)
       via  a45dca668e375bb4f4eaaf98521a3c3f5f82a0c9 (commit)
      from  e7653f3bab1d44b4dad65637982e72a15ede0a49 (commit)


- Log -----------------------------------------------------------------
commit 036e61b1669fee477af2d5d1afd0b015517f7f9a
Author: Matt Caswell <matt at openssl.org>
Date:   Tue Jun 14 11:45:34 2016 +0100

    Free memory on an error path
    
    The function a2i_ASN1_STRING can encounter an error after already
    allocating a buffer. It wasn't always freeing that buffer on error.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>

commit d285b5418ee1ff361f06545e0489ece61bdd1a50
Author: Matt Caswell <matt at openssl.org>
Date:   Tue Jun 14 11:27:10 2016 +0100

    Avoid a double-free in crl2pl7
    
    The variable |crtflst| could get double freed in an error path.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>

commit a45dca668e375bb4f4eaaf98521a3c3f5f82a0c9
Author: Matt Caswell <matt at openssl.org>
Date:   Tue Jun 14 11:21:44 2016 +0100

    Add missing break statement
    
    The -psk option processing was falling through to the -srp option
    processing in the ciphers app.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>

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

Summary of changes:
 apps/ciphers.c         | 1 +
 apps/crl2p7.c          | 4 +---
 crypto/asn1/f_string.c | 3 +++
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/apps/ciphers.c b/apps/ciphers.c
index 9e3b633..c0f43ea 100644
--- a/apps/ciphers.c
+++ b/apps/ciphers.c
@@ -139,6 +139,7 @@ int ciphers_main(int argc, char **argv)
 #ifndef OPENSSL_NO_PSK
             psk = 1;
 #endif
+            break;
         case OPT_SRP:
 #ifndef OPENSSL_NO_SRP
             srp = 1;
diff --git a/apps/crl2p7.c b/apps/crl2p7.c
index 1631258..9c5f79f 100644
--- a/apps/crl2p7.c
+++ b/apps/crl2p7.c
@@ -84,10 +84,8 @@ int crl2pkcs7_main(int argc, char **argv)
             if ((certflst == NULL)
                 && (certflst = sk_OPENSSL_STRING_new_null()) == NULL)
                 goto end;
-            if (!sk_OPENSSL_STRING_push(certflst, opt_arg())) {
-                sk_OPENSSL_STRING_free(certflst);
+            if (!sk_OPENSSL_STRING_push(certflst, opt_arg()))
                 goto end;
-            }
             break;
         }
     }
diff --git a/crypto/asn1/f_string.c b/crypto/asn1/f_string.c
index f9a77a2..0e03139 100644
--- a/crypto/asn1/f_string.c
+++ b/crypto/asn1/f_string.c
@@ -104,6 +104,7 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
         i -= again;
         if (i % 2 != 0) {
             ASN1err(ASN1_F_A2I_ASN1_STRING, ASN1_R_ODD_NUMBER_OF_CHARS);
+            OPENSSL_free(s);
             return 0;
         }
         i /= 2;
@@ -123,6 +124,7 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
                 if (m < 0) {
                     ASN1err(ASN1_F_A2I_ASN1_STRING,
                             ASN1_R_NON_HEX_CHARACTERS);
+                    OPENSSL_free(s);
                     return 0;
                 }
                 s[num + j] <<= 4;
@@ -141,5 +143,6 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
 
  err:
     ASN1err(ASN1_F_A2I_ASN1_STRING, ASN1_R_SHORT_LINE);
+    OPENSSL_free(s);
     return 0;
 }


More information about the openssl-commits mailing list