[Mesa-dev] [PATCH 2/2] anv: ensure device name contains terminating character

Chris Wilson chris at chris-wilson.co.uk
Sun Jul 16 14:35:28 UTC 2017


Quoting Lionel Landwerlin (2017-07-16 15:31:38)
> CID: 1415113
> Reported-by: Grazvydas Ignotas <notasas at gmail.com>
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> ---
>  src/intel/vulkan/anv_device.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
> index 34d4a675481..26a19e40a4b 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, VK_MAX_PHYSICAL_DEVICE_NAME_SIZE,

sizeof(pProperties->deviceName)?
-Chris


More information about the mesa-dev mailing list