From a1f187aa0c68978c09c9cbeae5ed792d5974027c Mon Sep 17 00:00:00 2001 From: Florian Wernli Date: Tue, 20 Feb 2024 09:39:41 +0100 Subject: [PATCH] fixup! pk11_uri: copy uri to new buffer with terminating null --- src/decoder.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/decoder.c b/src/decoder.c index 8c3c3636..3d238636 100644 --- a/src/decoder.c +++ b/src/decoder.c @@ -58,7 +58,9 @@ static char *obj_uri_get1(P11PROV_PK11_URI *obj) P11PROV_debug("Failed to get URI"); return NULL; } - return p11prov_alloc_sprintf(uri_len, "%s", uri); + char *null_terminated_uri = OPENSSL_zalloc(uri_len + 1); + memcpy(null_terminated_uri, uri, uri_len); + return null_terminated_uri; } struct desired_data_type_cbdata {