diff options
author | tb <> | 2022-02-11 17:39:36 +0000 |
---|---|---|
committer | tb <> | 2022-02-11 17:39:36 +0000 |
commit | 0bb62745ea220d7a3081409f24ecf9731a7f7afb (patch) | |
tree | fa4a7341783bfd4c3d8535954a9309f5526f61ab | |
parent | 7553d37f566450a198f4ed53c39672be6ad1f9a6 (diff) | |
download | openbsd-0bb62745ea220d7a3081409f24ecf9731a7f7afb.tar.gz openbsd-0bb62745ea220d7a3081409f24ecf9731a7f7afb.tar.bz2 openbsd-0bb62745ea220d7a3081409f24ecf9731a7f7afb.zip |
Add missing error check for a2i_GENERAL_NAME()
Fixes a segfault reported by Volker Schlecht.
ok jsing
-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); |