summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe <christophe@lunarg.com>2023-02-13 15:47:55 +0100
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>2023-02-14 10:30:44 -0700
commitdbad6e0dff5bae41560e2b18ea60ef90e0d1d798 (patch)
tree6a6a0d3a6150f26c919616378372472ae6f23240
parent933f8694effb75c1249e736eb7bfbdc66d9e0ae0 (diff)
downloadVulkan-Loader-dbad6e0dff5bae41560e2b18ea60ef90e0d1d798.tar.gz
Vulkan-Loader-dbad6e0dff5bae41560e2b18ea60ef90e0d1d798.tar.bz2
Vulkan-Loader-dbad6e0dff5bae41560e2b18ea60ef90e0d1d798.zip
A bit more safe string copy
-rw-r--r--loader/loader.c2
1 files changed, 1 insertions, 1 deletions
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]));
}
}