[Mesa-dev] [PATCH mesa] anv: use safer snprintf() to ensure NULL string-terminator
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Thu Aug 16 14:53:26 UTC 2018
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
On 16/08/18 15:46, Eric Engestrom wrote:
> Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
> ---
> src/intel/vulkan/anv_device.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
> index c40b94d69f349828b964..897249baa6aea4958c23 100644
> --- a/src/intel/vulkan/anv_device.c
> +++ b/src/intel/vulkan/anv_device.c
> @@ -325,7 +325,7 @@ anv_physical_device_init(struct anv_physical_device *device,
> device->instance = instance;
>
> assert(strlen(path) < ARRAY_SIZE(device->path));
> - strncpy(device->path, path, ARRAY_SIZE(device->path));
> + snprintf(device->path, ARRAY_SIZE(device->path), "%s", path);
>
> device->no_hw = getenv("INTEL_NO_HW") != NULL;
>
More information about the mesa-dev
mailing list