From: Tomas Mraz Date: Tue, 31 Aug 2021 07:05:59 +0000 (+0200) Subject: apps/pkcs12: Do not assume null termination of ASN1_UTF8STRING X-Git-Tag: openssl-3.0.0~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2bdab81198ae366d25547b1441609c7d324b0bb4;p=thirdparty%2Fopenssl.git apps/pkcs12: Do not assume null termination of ASN1_UTF8STRING Reviewed-by: Paul Dale Reviewed-by: Bernd Edlinger (Merged from https://github.com/openssl/openssl/pull/16433) --- diff --git a/apps/pkcs12.c b/apps/pkcs12.c index d745df84943..dcb173f201f 100644 --- a/apps/pkcs12.c +++ b/apps/pkcs12.c @@ -1142,7 +1142,8 @@ void print_attribute(BIO *out, const ASN1_TYPE *av) break; case V_ASN1_UTF8STRING: - BIO_printf(out, "%s\n", av->value.utf8string->data); + BIO_printf(out, "%.*s\n", av->value.utf8string->length, + av->value.utf8string->data); break; case V_ASN1_OCTET_STRING: