summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2021-08-31 09:05:59 +0200
committerTomas Mraz <tomas@openssl.org>2021-08-31 12:20:12 +0200
commit2bdab81198ae366d25547b1441609c7d324b0bb4 (patch)
tree683b263688d744e1625e600425c57e30d0ea7b11 /apps
parent3f7ad402b06fd75397f11fd9f0b2ad6778a31f99 (diff)
apps/pkcs12: Do not assume null termination of ASN1_UTF8STRING
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/16433)
Diffstat (limited to 'apps')
-rw-r--r--apps/pkcs12.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/pkcs12.c b/apps/pkcs12.c
index d745df8494..dcb173f201 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: