浏览代码

anv: use safer snprintf() to ensure NULL string-terminator

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
tags/18.3-branchpoint
Eric Engestrom 7 年前
父节点
当前提交
6cf0d4f91f
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      src/intel/vulkan/anv_device.c

+ 1
- 1
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;


正在加载...
取消
保存