[openssl] OpenSSL_1_1_1-stable update

nic.tuv at gmail.com nic.tuv at gmail.com
Wed Oct 16 12:58:12 UTC 2019


The branch OpenSSL_1_1_1-stable has been updated
       via  bf585d60fc4de00724a099faa66229ddafbebe00 (commit)
      from  7bcd13cebd9ebc6cf6026fff999beb34504a8068 (commit)


- Log -----------------------------------------------------------------
commit bf585d60fc4de00724a099faa66229ddafbebe00
Author: Cesar Pereida Garcia <cesar.pereidagarcia at tut.fi>
Date:   Thu Sep 12 16:58:50 2019 +0300

    [crypto/asn1/x_bignum.c] Explicit test against NULL
    
    As a fixup to https://github.com/openssl/openssl/pull/9779 to better
    conform to the project code style guidelines, this commit amends the
    original changeset to explicitly test against NULL, i.e. writing
    
    ```
    if (p != NULL)
    ```
    
    rather than
    
    ```
    if (!p)
    ```
    
    Reviewed-by: Nicola Tuveri <nic.tuv at gmail.com>
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9881)

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

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

diff --git a/crypto/asn1/x_bignum.c b/crypto/asn1/x_bignum.c
index 6c93ea7510..c6b3accd3a 100644
--- a/crypto/asn1/x_bignum.c
+++ b/crypto/asn1/x_bignum.c
@@ -82,7 +82,7 @@ static int bn_secure_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
 
 static void bn_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
 {
-    if (!*pval)
+    if (*pval == NULL)
         return;
     if (it->size & BN_SENSITIVE)
         BN_clear_free((BIGNUM *)*pval);
@@ -96,7 +96,7 @@ static int bn_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype,
 {
     BIGNUM *bn;
     int pad;
-    if (!*pval)
+    if (*pval == NULL)
         return -1;
     bn = (BIGNUM *)*pval;
     /* If MSB set in an octet we need a padding byte */
@@ -133,7 +133,7 @@ static int bn_secure_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
     int ret;
     BIGNUM *bn;
 
-    if (!*pval && !bn_secure_new(pval, it))
+    if (*pval == NULL && !bn_secure_new(pval, it))
         return 0;
 
     ret = bn_c2i(pval, cont, len, utype, free_cont, it);


More information about the openssl-commits mailing list