• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

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)

変更サマリ

差分

--- a/crypto/asn1/x_bignum.c
+++ b/crypto/asn1/x_bignum.c
@@ -102,7 +102,7 @@ ASN1_ITEM_end(CBIGNUM)
102102 static int bn_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
103103 {
104104 *pval = (ASN1_VALUE *)BN_new();
105- if (*pval)
105+ if (*pval != NULL)
106106 return 1;
107107 else
108108 return 0;
@@ -110,7 +110,7 @@ static int bn_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
110110
111111 static void bn_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
112112 {
113- if (!*pval)
113+ if (*pval == NULL)
114114 return;
115115 if (it->size & BN_SENSITIVE)
116116 BN_clear_free((BIGNUM *)*pval);
@@ -124,7 +124,7 @@ static int bn_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype,
124124 {
125125 BIGNUM *bn;
126126 int pad;
127- if (!*pval)
127+ if (*pval == NULL)
128128 return -1;
129129 bn = (BIGNUM *)*pval;
130130 /* If MSB set in an octet we need a padding byte */