diff options
author | Lionel Landwerlin <[email protected]> | 2017-07-16 15:28:09 +0100 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2017-07-17 14:36:38 +0100 |
commit | 59adde0eabd9585100b23c111f1783a67b6f7f4d (patch) | |
tree | 7434c6af47412faa4a308440e737f93fb92b6bb7 /src/intel/vulkan | |
parent | f03f893cb863d16e334d2c60784939cbb8150cd6 (diff) |
anv: ensure device name contains terminating character
v2: Use sizeof() (Chris)
CID: 1415113
Reported-by: Grazvydas Ignotas <[email protected]>
Signed-off-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r-- | src/intel/vulkan/anv_device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 34d4a675481..7e3eae43081 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -891,8 +891,8 @@ void anv_GetPhysicalDeviceProperties( .sparseProperties = {0}, /* Broadwell doesn't do sparse. */ }; - strncpy(pProperties->deviceName, pdevice->name, - VK_MAX_PHYSICAL_DEVICE_NAME_SIZE); + snprintf(pProperties->deviceName, sizeof(pProperties->deviceName), + "%s", pdevice->name); memcpy(pProperties->pipelineCacheUUID, pdevice->pipeline_cache_uuid, VK_UUID_SIZE); } |