diff options
| author | jsing <> | 2015-02-14 13:32:46 +0000 | 
|---|---|---|
| committer | jsing <> | 2015-02-14 13:32:46 +0000 | 
| commit | e2784ea0eadb4672a77993d540ef3be8ed05f3be (patch) | |
| tree | 4662e808b6c38d0467e9e0bc33b8933170e6e70b | |
| parent | 67f5fc050c82d7526b6add1ca9b85f39e47b24d8 (diff) | |
| download | openbsd-e2784ea0eadb4672a77993d540ef3be8ed05f3be.tar.gz openbsd-e2784ea0eadb4672a77993d540ef3be8ed05f3be.tar.bz2 openbsd-e2784ea0eadb4672a77993d540ef3be8ed05f3be.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@
| -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; | 
