TLS/SSL and crypto library
リビジョン | 0159a1bb41b385a00836e9e7baeadad2f014b788 (tree) |
---|---|
日時 | 2019-10-16 22:01:58 |
作者 | Cesar Pereida Garcia <cesar.pereidagarcia@tut....> |
コミッター | Nicola Tuveri |
[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)
@@ -102,7 +102,7 @@ ASN1_ITEM_end(CBIGNUM) | ||
102 | 102 | static int bn_new(ASN1_VALUE **pval, const ASN1_ITEM *it) |
103 | 103 | { |
104 | 104 | *pval = (ASN1_VALUE *)BN_new(); |
105 | - if (*pval) | |
105 | + if (*pval != NULL) | |
106 | 106 | return 1; |
107 | 107 | else |
108 | 108 | return 0; |
@@ -110,7 +110,7 @@ static int bn_new(ASN1_VALUE **pval, const ASN1_ITEM *it) | ||
110 | 110 | |
111 | 111 | static void bn_free(ASN1_VALUE **pval, const ASN1_ITEM *it) |
112 | 112 | { |
113 | - if (!*pval) | |
113 | + if (*pval == NULL) | |
114 | 114 | return; |
115 | 115 | if (it->size & BN_SENSITIVE) |
116 | 116 | BN_clear_free((BIGNUM *)*pval); |
@@ -124,7 +124,7 @@ static int bn_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, | ||
124 | 124 | { |
125 | 125 | BIGNUM *bn; |
126 | 126 | int pad; |
127 | - if (!*pval) | |
127 | + if (*pval == NULL) | |
128 | 128 | return -1; |
129 | 129 | bn = (BIGNUM *)*pval; |
130 | 130 | /* If MSB set in an octet we need a padding byte */ |