From 9685dac01c1179459a17b8f0c785c3ae132e3400 Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 20 May 2022 07:58:54 +0000 Subject: [PATCH] Don't pass uninitialized pointer to ASN1_STRING_to_UTF8() Exposed by recent rewrite of ASN1_STRING_to_UTF8(). CID 352831 ok jsing --- lib/libcrypto/x509/x509_utl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/x509/x509_utl.c b/lib/libcrypto/x509/x509_utl.c index 0fa6ea6d547..47b25fe6c4f 100644 --- a/lib/libcrypto/x509/x509_utl.c +++ b/lib/libcrypto/x509/x509_utl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_utl.c,v 1.2 2020/09/13 15:06:17 beck Exp $ */ +/* $OpenBSD: x509_utl.c,v 1.3 2022/05/20 07:58:54 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -954,7 +954,7 @@ do_check_string(ASN1_STRING *a, int cmp_type, equal_fn equal, rv = -1; } else { int astrlen; - unsigned char *astr; + unsigned char *astr = NULL; astrlen = ASN1_STRING_to_UTF8(&astr, a); if (astrlen < 0) return -1; -- 2.20.1