anv: don't use strcpy for copying strings
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 13 Jul 2017 15:35:01 +0000 (16:35 +0100)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 13 Jul 2017 21:50:47 +0000 (22:50 +0100)
CID: 1358935
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/intel/vulkan/anv_device.c

index 39c907e9f2da50aaaca4ddd12b13f2b35a4207c1..d3607deccfc3c08e88ed632a7bb8c0b4372d3c4e 100644 (file)
@@ -895,7 +895,8 @@ void anv_GetPhysicalDeviceProperties(
       .sparseProperties = {0}, /* Broadwell doesn't do sparse. */
    };
 
-   strcpy(pProperties->deviceName, pdevice->name);
+   strncpy(pProperties->deviceName, pdevice->name,
+           VK_MAX_PHYSICAL_DEVICE_NAME_SIZE);
    memcpy(pProperties->pipelineCacheUUID,
           pdevice->pipeline_cache_uuid, VK_UUID_SIZE);
 }