diff options
author | Charles Giessen <charles@lunarg.com> | 2022-07-30 00:49:56 +0300 |
---|---|---|
committer | Charles Giessen <46324611+charles-lunarg@users.noreply.github.com> | 2022-07-30 01:09:29 +0300 |
commit | d4801c93c599053e2c7f297906ea65144aff370a (patch) | |
tree | 5ca0383b4291d239fb4c7e0e1705626bcf60deec | |
parent | 0bcddf345feb45e19441025de6a256e19b44f88d (diff) |
Use memmove for copying pApplicationInfo
Replace memcpy with memmove in terminator_CreateInstance to prevent possible issues
with the same memory being the source of the copy and the dest, as there is a for
loop which makes it possible for that to happen.
-rw-r--r-- | loader/loader.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/loader/loader.c b/loader/loader.c index f41d460f8..b74ec4cb6 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -5323,7 +5323,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance(const VkInstanceCreateI if (icd_create_info.pApplicationInfo == NULL) { memset(&icd_app_info, 0, sizeof(icd_app_info)); } else { - memcpy(&icd_app_info, icd_create_info.pApplicationInfo, sizeof(icd_app_info)); + memmove(&icd_app_info, icd_create_info.pApplicationInfo, sizeof(icd_app_info)); } icd_app_info.apiVersion = icd_version; icd_create_info.pApplicationInfo = &icd_app_info; |