diff options
| author | tb <> | 2022-02-11 17:39:36 +0000 |
|---|---|---|
| committer | tb <> | 2022-02-11 17:39:36 +0000 |
| commit | 911e0aa6f16aba90dc8107a37cd5e01f041fc86a (patch) | |
| tree | fa4a7341783bfd4c3d8535954a9309f5526f61ab /src/lib/libcrypto/x509 | |
| parent | 3e9423819d5b05b96cf6ad8d411708c75f9afbc5 (diff) | |
| download | openbsd-911e0aa6f16aba90dc8107a37cd5e01f041fc86a.tar.gz openbsd-911e0aa6f16aba90dc8107a37cd5e01f041fc86a.tar.bz2 openbsd-911e0aa6f16aba90dc8107a37cd5e01f041fc86a.zip | |
Add missing error check for a2i_GENERAL_NAME()
Fixes a segfault reported by Volker Schlecht.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/x509')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_alt.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509/x509_alt.c b/src/lib/libcrypto/x509/x509_alt.c index 9dbca9d1e9..52d30f91e8 100644 --- a/src/lib/libcrypto/x509/x509_alt.c +++ b/src/lib/libcrypto/x509/x509_alt.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_alt.c,v 1.6 2022/02/11 17:37:54 tb Exp $ */ | 1 | /* $OpenBSD: x509_alt.c,v 1.7 2022/02/11 17:39:36 tb 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. | 3 | * project. |
| 4 | */ | 4 | */ |
| @@ -649,6 +649,8 @@ v2i_GENERAL_NAME_ex(GENERAL_NAME *out, const X509V3_EXT_METHOD *method, | |||
| 649 | } | 649 | } |
| 650 | 650 | ||
| 651 | ret = a2i_GENERAL_NAME(out, method, ctx, type, value, is_nc); | 651 | ret = a2i_GENERAL_NAME(out, method, ctx, type, value, is_nc); |
| 652 | if (ret == NULL) | ||
| 653 | return NULL; | ||
| 652 | 654 | ||
| 653 | /* Validate what we have for sanity */ | 655 | /* Validate what we have for sanity */ |
| 654 | type = x509_constraints_general_to_bytes(ret, &bytes, &len); | 656 | type = x509_constraints_general_to_bytes(ret, &bytes, &len); |
