diff options
| author | bluhm <> | 2018-04-06 12:16:06 +0000 |
|---|---|---|
| committer | bluhm <> | 2018-04-06 12:16:06 +0000 |
| commit | 04eb7629f2f23e270106e093b225bf7ed58c0f5b (patch) | |
| tree | b79f8000ef7037cf59cdd156f2ff32f0d6e79840 | |
| parent | 9960bddd07f53a7bf1a404e8165dabde4e956976 (diff) | |
| download | openbsd-04eb7629f2f23e270106e093b225bf7ed58c0f5b.tar.gz openbsd-04eb7629f2f23e270106e093b225bf7ed58c0f5b.tar.bz2 openbsd-04eb7629f2f23e270106e093b225bf7ed58c0f5b.zip | |
Revert revision 1.12 commit. Although *pval looks like a C pointer,
it may be something else. For primitive types it is possible that
a boolean int has been casted to an ASN1_VALUE pointer. Then the
64 bit read access to *pval may crash due to alignent or 32 bit
size.
bug report Anton Borowka; OK tedu@ jsing@ miod@
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/asn1/tasn_fre.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/libcrypto/asn1/tasn_fre.c b/src/lib/libcrypto/asn1/tasn_fre.c index 9276034808..c05310ec28 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.15 2016/12/30 16:04:34 jsing Exp $ */ | 1 | /* $OpenBSD: tasn_fre.c,v 1.16 2018/04/06 12:16:06 bluhm 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 | */ |
| @@ -88,7 +88,10 @@ asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine) | |||
| 88 | ASN1_aux_cb *asn1_cb = NULL; | 88 | ASN1_aux_cb *asn1_cb = NULL; |
| 89 | int i; | 89 | int i; |
| 90 | 90 | ||
| 91 | if (pval == NULL || *pval == NULL) | 91 | if (pval == NULL) |
| 92 | return; | ||
| 93 | /* For primitive types *pval may be something other than C pointer. */ | ||
| 94 | if (it->itype != ASN1_ITYPE_PRIMITIVE && *pval == NULL) | ||
| 92 | return; | 95 | return; |
| 93 | 96 | ||
| 94 | if (aux != NULL && aux->asn1_cb != NULL) | 97 | if (aux != NULL && aux->asn1_cb != NULL) |
