From b356bd237ca304c0951fd4fb91d658ed2d2c54f4 Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 20 May 2022 08:00:05 +0000 Subject: [PATCH] Don't pass uninitialized pointer to ASN1_STRING_to_UTF8() Exposed by recent rewrite of ASN1_STRING_to_UTF8(). Found via grep after fixing CID 352831. ok jsing --- lib/libcrypto/pkcs12/p12_kiss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/pkcs12/p12_kiss.c b/lib/libcrypto/pkcs12/p12_kiss.c index 54a80926095..1e221f4436c 100644 --- a/lib/libcrypto/pkcs12/p12_kiss.c +++ b/lib/libcrypto/pkcs12/p12_kiss.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p12_kiss.c,v 1.21 2021/07/09 14:08:00 tb Exp $ */ +/* $OpenBSD: p12_kiss.c,v 1.22 2022/05/20 08:00:05 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -265,7 +265,7 @@ parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen, EVP_PKEY **pkey, } if (fname) { int len, r; - unsigned char *data; + unsigned char *data = NULL; len = ASN1_STRING_to_UTF8(&data, fname); if (len >= 0) { r = X509_alias_set1(x509, data, len); -- 2.20.1