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

Samuel Iglesias Gonsálvez siglesias at igalia.com
Mon Jul 17 04:58:56 UTC 2017


Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>

On Mon, 2017-07-17 at 00:29 +0100, Lionel Landwerlin wrote:
> v2: Use sizeof() (Chris)
> 
> 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..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);
>  }
> --
> 2.13.2
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170717/690a10d5/attachment.sig>


More information about the mesa-dev mailing list