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

Dr. Stephen Henson steve at openssl.org
Mon May 2 21:52:58 UTC 2016


The branch OpenSSL_1_0_2-stable has been updated
       via  c5e603ee182b40ede7713c6e229c15a8f3fdb58a (commit)
      from  a8d40f64d820e199c87a21597acd92a530286885 (commit)


- Log -----------------------------------------------------------------
commit c5e603ee182b40ede7713c6e229c15a8f3fdb58a
Author: Dr. Stephen Henson <steve at openssl.org>
Date:   Mon May 2 17:33:50 2016 +0100

    Fix i2d_X509_AUX: pp can be NULL.
    
    Reported by David Benjamin
    
    Reviewed-by: Emilia Käsper <emilia at openssl.org>
    (cherry picked from commit 05aef4bbdbc18e7b9490512cdee41e8a608bcc0e)

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

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

diff --git a/crypto/asn1/x_x509.c b/crypto/asn1/x_x509.c
index ccdf6df..e31e1e7 100644
--- a/crypto/asn1/x_x509.c
+++ b/crypto/asn1/x_x509.c
@@ -202,14 +202,15 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length)
 int i2d_X509_AUX(X509 *a, unsigned char **pp)
 {
     int length, tmplen;
-    unsigned char *start = *pp;
+    unsigned char *start = pp != NULL ? *pp : NULL;
     length = i2d_X509(a, pp);
     if (length < 0 || a == NULL)
         return length;
 
     tmplen = i2d_X509_CERT_AUX(a->aux, pp);
     if (tmplen < 0) {
-        *pp = start;
+        if (start != NULL)
+            *pp = start;
         return tmplen;
     }
     length += tmplen;


More information about the openssl-commits mailing list