From dbad6e0dff5bae41560e2b18ea60ef90e0d1d798 Mon Sep 17 00:00:00 2001 From: Christophe Date: Mon, 13 Feb 2023 15:47:55 +0100 Subject: A bit more safe string copy --- loader/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/loader.c b/loader/loader.c index 6831bcac..95d5f9b7 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -4720,7 +4720,7 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, c size_t size = strlen(pCreateInfo->ppEnabledLayerNames[i]) + 1; inst->enabled_layer_names[i] = (char *)loader_instance_heap_calloc(inst, sizeof(char) * size, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); - strcpy(inst->enabled_layer_names[i], pCreateInfo->ppEnabledLayerNames[i]); + strncpy(inst->enabled_layer_names[i], pCreateInfo->ppEnabledLayerNames[i], strlen(pCreateInfo->ppEnabledLayerNames[i])); } } -- cgit v1.2.3