diff options
author | jsing <> | 2015-02-14 13:32:46 +0000 |
---|---|---|
committer | jsing <> | 2015-02-14 13:32:46 +0000 |
commit | b8d9c2ac1e0d5ebc096503ffa770326846a8fb7c (patch) | |
tree | 4662e808b6c38d0467e9e0bc33b8933170e6e70b /src | |
parent | bed3446d294aa19d5397da1bf8f920c94378b9f3 (diff) | |
download | openbsd-b8d9c2ac1e0d5ebc096503ffa770326846a8fb7c.tar.gz openbsd-b8d9c2ac1e0d5ebc096503ffa770326846a8fb7c.tar.bz2 openbsd-b8d9c2ac1e0d5ebc096503ffa770326846a8fb7c.zip |
Spell NULL correctly, be explicit with NULL checks and it is also easier to
initialise during declaration and drop the else statement.
ok doug@ miod@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/asn1/tasn_fre.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/tasn_new.c | 8 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/asn1/tasn_fre.c | 8 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/asn1/tasn_new.c | 8 |
4 files changed, 12 insertions, 20 deletions
diff --git a/src/lib/libcrypto/asn1/tasn_fre.c b/src/lib/libcrypto/asn1/tasn_fre.c index d8d55a536c..36b668a7f9 100644 --- a/src/lib/libcrypto/asn1/tasn_fre.c +++ b/src/lib/libcrypto/asn1/tasn_fre.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tasn_fre.c,v 1.12 2014/07/10 12:24:25 tedu Exp $ */ | 1 | /* $OpenBSD: tasn_fre.c,v 1.13 2015/02/14 13:32:46 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -86,16 +86,14 @@ asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine) | |||
86 | const ASN1_EXTERN_FUNCS *ef; | 86 | const ASN1_EXTERN_FUNCS *ef; |
87 | const ASN1_COMPAT_FUNCS *cf; | 87 | const ASN1_COMPAT_FUNCS *cf; |
88 | const ASN1_AUX *aux = it->funcs; | 88 | const ASN1_AUX *aux = it->funcs; |
89 | ASN1_aux_cb *asn1_cb; | 89 | ASN1_aux_cb *asn1_cb = NULL; |
90 | int i; | 90 | int i; |
91 | 91 | ||
92 | if (pval == NULL || *pval == NULL) | 92 | if (pval == NULL || *pval == NULL) |
93 | return; | 93 | return; |
94 | 94 | ||
95 | if (aux && aux->asn1_cb) | 95 | if (aux != NULL && aux->asn1_cb != NULL) |
96 | asn1_cb = aux->asn1_cb; | 96 | asn1_cb = aux->asn1_cb; |
97 | else | ||
98 | asn1_cb = 0; | ||
99 | 97 | ||
100 | switch (it->itype) { | 98 | switch (it->itype) { |
101 | case ASN1_ITYPE_PRIMITIVE: | 99 | case ASN1_ITYPE_PRIMITIVE: |
diff --git a/src/lib/libcrypto/asn1/tasn_new.c b/src/lib/libcrypto/asn1/tasn_new.c index 88ee5c5224..cbc6bfc1d5 100644 --- a/src/lib/libcrypto/asn1/tasn_new.c +++ b/src/lib/libcrypto/asn1/tasn_new.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tasn_new.c,v 1.11 2014/06/12 15:49:27 deraadt Exp $ */ | 1 | /* $OpenBSD: tasn_new.c,v 1.12 2015/02/14 13:32:46 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -94,14 +94,12 @@ asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine) | |||
94 | const ASN1_COMPAT_FUNCS *cf; | 94 | const ASN1_COMPAT_FUNCS *cf; |
95 | const ASN1_EXTERN_FUNCS *ef; | 95 | const ASN1_EXTERN_FUNCS *ef; |
96 | const ASN1_AUX *aux = it->funcs; | 96 | const ASN1_AUX *aux = it->funcs; |
97 | ASN1_aux_cb *asn1_cb; | 97 | ASN1_aux_cb *asn1_cb = NULL; |
98 | ASN1_VALUE **pseqval; | 98 | ASN1_VALUE **pseqval; |
99 | int i; | 99 | int i; |
100 | 100 | ||
101 | if (aux && aux->asn1_cb) | 101 | if (aux != NULL && aux->asn1_cb != NULL) |
102 | asn1_cb = aux->asn1_cb; | 102 | asn1_cb = aux->asn1_cb; |
103 | else | ||
104 | asn1_cb = 0; | ||
105 | 103 | ||
106 | if (!combine) | 104 | if (!combine) |
107 | *pval = NULL; | 105 | *pval = NULL; |
diff --git a/src/lib/libssl/src/crypto/asn1/tasn_fre.c b/src/lib/libssl/src/crypto/asn1/tasn_fre.c index d8d55a536c..36b668a7f9 100644 --- a/src/lib/libssl/src/crypto/asn1/tasn_fre.c +++ b/src/lib/libssl/src/crypto/asn1/tasn_fre.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tasn_fre.c,v 1.12 2014/07/10 12:24:25 tedu Exp $ */ | 1 | /* $OpenBSD: tasn_fre.c,v 1.13 2015/02/14 13:32:46 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -86,16 +86,14 @@ asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine) | |||
86 | const ASN1_EXTERN_FUNCS *ef; | 86 | const ASN1_EXTERN_FUNCS *ef; |
87 | const ASN1_COMPAT_FUNCS *cf; | 87 | const ASN1_COMPAT_FUNCS *cf; |
88 | const ASN1_AUX *aux = it->funcs; | 88 | const ASN1_AUX *aux = it->funcs; |
89 | ASN1_aux_cb *asn1_cb; | 89 | ASN1_aux_cb *asn1_cb = NULL; |
90 | int i; | 90 | int i; |
91 | 91 | ||
92 | if (pval == NULL || *pval == NULL) | 92 | if (pval == NULL || *pval == NULL) |
93 | return; | 93 | return; |
94 | 94 | ||
95 | if (aux && aux->asn1_cb) | 95 | if (aux != NULL && aux->asn1_cb != NULL) |
96 | asn1_cb = aux->asn1_cb; | 96 | asn1_cb = aux->asn1_cb; |
97 | else | ||
98 | asn1_cb = 0; | ||
99 | 97 | ||
100 | switch (it->itype) { | 98 | switch (it->itype) { |
101 | case ASN1_ITYPE_PRIMITIVE: | 99 | case ASN1_ITYPE_PRIMITIVE: |
diff --git a/src/lib/libssl/src/crypto/asn1/tasn_new.c b/src/lib/libssl/src/crypto/asn1/tasn_new.c index 88ee5c5224..cbc6bfc1d5 100644 --- a/src/lib/libssl/src/crypto/asn1/tasn_new.c +++ b/src/lib/libssl/src/crypto/asn1/tasn_new.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tasn_new.c,v 1.11 2014/06/12 15:49:27 deraadt Exp $ */ | 1 | /* $OpenBSD: tasn_new.c,v 1.12 2015/02/14 13:32:46 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -94,14 +94,12 @@ asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine) | |||
94 | const ASN1_COMPAT_FUNCS *cf; | 94 | const ASN1_COMPAT_FUNCS *cf; |
95 | const ASN1_EXTERN_FUNCS *ef; | 95 | const ASN1_EXTERN_FUNCS *ef; |
96 | const ASN1_AUX *aux = it->funcs; | 96 | const ASN1_AUX *aux = it->funcs; |
97 | ASN1_aux_cb *asn1_cb; | 97 | ASN1_aux_cb *asn1_cb = NULL; |
98 | ASN1_VALUE **pseqval; | 98 | ASN1_VALUE **pseqval; |
99 | int i; | 99 | int i; |
100 | 100 | ||
101 | if (aux && aux->asn1_cb) | 101 | if (aux != NULL && aux->asn1_cb != NULL) |
102 | asn1_cb = aux->asn1_cb; | 102 | asn1_cb = aux->asn1_cb; |
103 | else | ||
104 | asn1_cb = 0; | ||
105 | 103 | ||
106 | if (!combine) | 104 | if (!combine) |
107 | *pval = NULL; | 105 | *pval = NULL; |