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


- Log -----------------------------------------------------------------
commit ffcdb0e6efb6fb7033b2cd29e8cca2e2fe355c14
Author: Matt Caswell <[email protected]>
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 <[email protected]>
    (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) {
_____
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits

Reply via email to