[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 5/6] adapter: fix Unitialized *Interface in _QueryInterface


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>
  • Date: Mon, 5 Oct 2026 18:03:30 +0200
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
  • Cc: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>
  • Delivery-date: Mon, 05 Oct 2026 16:03:49 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

Static code analysis raised a warning on *Interface in _QueryInterface
which is annotated as _Out_, but is not written by _QueryInterface on
the success path.
*Interface is filled when calling IoCallDriver(DeficeObject, Irp) down the
stack on the success path so the warning can just be suppressed by
initializing it.

Signed-off-by: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>
---
 src/xennet/adapter.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/xennet/adapter.c b/src/xennet/adapter.c
index f1414fc..965315d 100644
--- a/src/xennet/adapter.c
+++ b/src/xennet/adapter.c
@@ -2798,6 +2798,7 @@ __QueryInterface(
 
     KeInitializeEvent(&Event, NotificationEvent, FALSE);
     RtlZeroMemory(&StatusBlock, sizeof(StatusBlock));
+    RtlZeroMemory(Interface, Size);
 
     Irp = IoBuildSynchronousFsdRequest(IRP_MJ_PNP,
                                        DeviceObject,
-- 
2.55.0.windows.5



--
Césaire Mounah | Vates Windows Guest Tools Engineer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.