From 095a0d1b186fe422c110413fc75ac0ed28eb6874 Mon Sep 17 00:00:00 2001 From: Aveen Ismail Date: Thu, 27 Apr 2023 10:23:53 +0200 Subject: [PATCH] PKCS11: meta_objects: Fix potential bufferoverflow --- pkcs11/tests/meta_object_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkcs11/tests/meta_object_test.c b/pkcs11/tests/meta_object_test.c index c38a9b49..6c5d6508 100644 --- a/pkcs11/tests/meta_object_test.c +++ b/pkcs11/tests/meta_object_test.c @@ -61,7 +61,7 @@ static CK_SESSION_HANDLE open_test_session(char *password) { } char config[256]; assert(strlen(connector_url) + strlen("connector=") < 256); - sprintf(config, "connector=%s", connector_url); + snprintf(config, sizeof(config), "connector=%s", connector_url); initArgs.pReserved = (void *) config; CK_RV rv = p11->C_Initialize(&initArgs); assert(rv == CKR_OK);