diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2023-10-11 13:12:47 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2023-10-11 13:12:47 +0000 |
commit | d09c31f6f5b5adc24e34ab2865af09758fe02cd7 (patch) | |
tree | 99ceaecf6ec18e3713f15b448fbac52be58295c1 /lib | |
parent | 1f66e13af01f3e1e3be41146b340db60382a1372 (diff) |
Ensure that out_value is initialized even if out_type is NULL
This fixes the printf in the x509_algor regress.
ok jsing
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libcrypto/asn1/x_algor.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libcrypto/asn1/x_algor.c b/lib/libcrypto/asn1/x_algor.c index 47bde7b97e2..08742c5f1c9 100644 --- a/lib/libcrypto/asn1/x_algor.c +++ b/lib/libcrypto/asn1/x_algor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_algor.c,v 1.28 2023/10/11 13:10:13 tb Exp $ */ +/* $OpenBSD: x_algor.c,v 1.29 2023/10/11 13:12:46 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -185,6 +185,10 @@ X509_ALGOR_get0(const ASN1_OBJECT **out_aobj, int *out_type, if (out_aobj != NULL) *out_aobj = alg->algorithm; + /* Ensure out_value is not left uninitialized if out_type is NULL. */ + if (out_value != NULL) + *out_value = NULL; + if (out_type == NULL) return; |