diff options
author | Cesar Pereida Garcia <cesar.pereidagarcia@tut.fi> | 2019-09-12 17:09:51 +0300 |
---|---|---|
committer | Nicola Tuveri <nic.tuv@gmail.com> | 2019-10-16 16:01:58 +0300 |
commit | 0159a1bb41b385a00836e9e7baeadad2f014b788 (patch) | |
tree | 6386115118c1a93d2db8c5e4b9c19a93664dd916 | |
parent | 4e545c6a256fb1ab08cc5a3aabb00963dac3191b (diff) | |
download | openssl-0159a1bb41b385a00836e9e7baeadad2f014b788.zip openssl-0159a1bb41b385a00836e9e7baeadad2f014b788.tar.gz openssl-0159a1bb41b385a00836e9e7baeadad2f014b788.tar.bz2 |
[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)
```
(This is a backport of https://github.com/openssl/openssl/pull/9881)
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9882)
-rw-r--r-- | crypto/asn1/x_bignum.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/asn1/x_bignum.c b/crypto/asn1/x_bignum.c index c644199..f2de3de 100644 --- a/crypto/asn1/x_bignum.c +++ b/crypto/asn1/x_bignum.c @@ -102,7 +102,7 @@ ASN1_ITEM_end(CBIGNUM) static int bn_new(ASN1_VALUE **pval, const ASN1_ITEM *it) { *pval = (ASN1_VALUE *)BN_new(); - if (*pval) + if (*pval != NULL) return 1; else return 0; @@ -110,7 +110,7 @@ static int bn_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); @@ -124,7 +124,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 */ |