The branch OpenSSL_1_0_1-stable has been updated
       via  1915a22184f879f8008e2447214f515a20045314 (commit)
      from  a6ce498b2a00ea7bdca0730064d7ee62b77d87cb (commit)


- Log -----------------------------------------------------------------
commit 1915a22184f879f8008e2447214f515a20045314
Author: mrpre <mr...@163.com>
Date:   Fri Aug 28 16:12:51 2015 +0800

    check bn_new return value
    
    Slightly modified from the original PR.
    Signed-off-by: Rich Salz <rs...@akamai.com>
    Reviewed-by: Richard Levitte <levi...@openssl.org>
    
    (cherry picked from commit a7e974c7be90e2c9673e2ce6215a70f734eb8ad4)

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

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

diff --git a/crypto/asn1/x_bignum.c b/crypto/asn1/x_bignum.c
index a5a403c..eaf0466 100644
--- a/crypto/asn1/x_bignum.c
+++ b/crypto/asn1/x_bignum.c
@@ -141,8 +141,9 @@ static int bn_c2i(ASN1_VALUE **pval, const unsigned char 
*cont, int len,
                   int utype, char *free_cont, const ASN1_ITEM *it)
 {
     BIGNUM *bn;
-    if (!*pval)
-        bn_new(pval, it);
+
+    if (*pval == NULL && !bn_new(pval, it))
+        return 0;
     bn = (BIGNUM *)*pval;
     if (!BN_bin2bn(cont, len, bn)) {
         bn_free(pval, it);
_____
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits

Reply via email to