anv: Memset array properties
authorJason Ekstrand <jason@jlekstrand.net>
Mon, 13 Jan 2020 19:49:57 +0000 (13:49 -0600)
committerMarge Bot <eric+marge@anholt.net>
Mon, 13 Jan 2020 22:33:55 +0000 (22:33 +0000)
This is probably better than possibly leaving those bytes uninitialized
even if the app will theoretically not use them.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3369>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3369>

src/intel/vulkan/anv_device.c

index a4cb669108661992c73c5b30e7fdd0dbdc282631..cd7298ab3c57db07092700daab7ebaed4386e9f1 100644 (file)
@@ -1538,9 +1538,13 @@ void anv_GetPhysicalDeviceProperties2(
             (VkPhysicalDeviceDriverPropertiesKHR *) ext;
 
          driver_props->driverID = VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR;
+         memset(driver_props->driverName, 0,
+                sizeof(driver_props->driverName));
          snprintf(driver_props->driverName, VK_MAX_DRIVER_NAME_SIZE_KHR,
                   "Intel open-source Mesa driver");
 
+         memset(driver_props->driverInfo, 0,
+                sizeof(driver_props->driverInfo));
          snprintf(driver_props->driverInfo, VK_MAX_DRIVER_INFO_SIZE_KHR,
                   "Mesa " PACKAGE_VERSION MESA_GIT_SHA1);
 
@@ -1567,6 +1571,7 @@ void anv_GetPhysicalDeviceProperties2(
          memcpy(id_props->deviceUUID, pdevice->device_uuid, VK_UUID_SIZE);
          memcpy(id_props->driverUUID, pdevice->driver_uuid, VK_UUID_SIZE);
          /* The LUID is for Windows. */
+         memset(id_props->deviceLUID, 0, VK_UUID_SIZE);
          id_props->deviceLUIDValid = false;
          break;
       }