From: Lionel Landwerlin Date: Sun, 16 Jul 2017 14:28:09 +0000 (+0100) Subject: anv: ensure device name contains terminating character X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=59adde0eabd9585100b23c111f1783a67b6f7f4d;p=mesa.git anv: ensure device name contains terminating character v2: Use sizeof() (Chris) CID: 1415113 Reported-by: Grazvydas Ignotas Signed-off-by: Lionel Landwerlin Reviewed-by: Kenneth Graunke Reviewed-by: Samuel Iglesias Gonsálvez --- 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); }