[openssl-commits] [openssl] OpenSSL_1_0_2-stable update

Matt Caswell matt at openssl.org
Tue Mar 21 14:11:55 UTC 2017


The branch OpenSSL_1_0_2-stable has been updated
       via  ffcdb0e6efb6fb7033b2cd29e8cca2e2fe355c14 (commit)
      from  3f640ebd035006d44d6f7d0767bb6ebd1a2efcd5 (commit)


- Log -----------------------------------------------------------------
commit ffcdb0e6efb6fb7033b2cd29e8cca2e2fe355c14
Author: Matt Caswell <matt at openssl.org>
Date:   Tue Mar 21 09:07:17 2017 +0000

    Fix error paths in ASN1_TIME_to_generalizedtime
    
    We should not write to |out| in error cases, so we should defer doing this
    until the "done" block.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/3002)

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

Summary of changes:
 crypto/asn1/a_time.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/crypto/asn1/a_time.c b/crypto/asn1/a_time.c
index 6074325..0eeb79c 100644
--- a/crypto/asn1/a_time.c
+++ b/crypto/asn1/a_time.c
@@ -147,10 +147,9 @@ ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t,
     if (!out || !*out) {
         if (!(ret = ASN1_GENERALIZEDTIME_new()))
             goto err;
-        if (out)
-            *out = ret;
-    } else
+    } else {
         ret = *out;
+    }
 
     /* If already GeneralizedTime just copy across */
     if (t->type == V_ASN1_GENERALIZEDTIME) {


More information about the openssl-commits mailing list