diff options
author | tb <> | 2023-10-11 13:12:46 +0000 |
---|---|---|
committer | tb <> | 2023-10-11 13:12:46 +0000 |
commit | b2211cd9ad888832934da32064d3e7794fee1b20 (patch) | |
tree | 6f00ff7cab311391118ee2cd6433bbb746952f38 /src/lib | |
parent | adc917a287144d58c409d2945fd723f8164f150a (diff) | |
download | openbsd-b2211cd9ad888832934da32064d3e7794fee1b20.tar.gz openbsd-b2211cd9ad888832934da32064d3e7794fee1b20.tar.bz2 openbsd-b2211cd9ad888832934da32064d3e7794fee1b20.zip |
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 'src/lib')
-rw-r--r-- | src/lib/libcrypto/asn1/x_algor.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/libcrypto/asn1/x_algor.c b/src/lib/libcrypto/asn1/x_algor.c index 47bde7b97e..08742c5f1c 100644 --- a/src/lib/libcrypto/asn1/x_algor.c +++ b/src/lib/libcrypto/asn1/x_algor.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x_algor.c,v 1.28 2023/10/11 13:10:13 tb Exp $ */ | 1 | /* $OpenBSD: x_algor.c,v 1.29 2023/10/11 13:12:46 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 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -185,6 +185,10 @@ X509_ALGOR_get0(const ASN1_OBJECT **out_aobj, int *out_type, | |||
185 | if (out_aobj != NULL) | 185 | if (out_aobj != NULL) |
186 | *out_aobj = alg->algorithm; | 186 | *out_aobj = alg->algorithm; |
187 | 187 | ||
188 | /* Ensure out_value is not left uninitialized if out_type is NULL. */ | ||
189 | if (out_value != NULL) | ||
190 | *out_value = NULL; | ||
191 | |||
188 | if (out_type == NULL) | 192 | if (out_type == NULL) |
189 | return; | 193 | return; |
190 | 194 | ||