From: Christophe Date: Mon, 13 Feb 2023 14:47:55 +0000 (+0100) Subject: A bit more safe string copy X-Git-Tag: upstream/1.3.268~221 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dbad6e0dff5bae41560e2b18ea60ef90e0d1d798;p=platform%2Fupstream%2FVulkan-Loader.git A bit more safe string copy --- 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])); } }