[ovs-dev] [PATCH 28/40] datapath-windows: Fix possible NULL deference in OvsFullCopyNBL

Shashank Ram rams at vmware.com
Fri Jul 14 17:15:41 UTC 2017





________________________________________
From: ovs-dev-bounces at openvswitch.org <ovs-dev-bounces at openvswitch.org> on behalf of Alin Serdean <aserdean at cloudbasesolutions.com>
Sent: Thursday, July 13, 2017 9:40 PM
To: dev at openvswitch.org
Subject: [ovs-dev] [PATCH 28/40] datapath-windows: Fix possible NULL deference in OvsFullCopyNBL

Check if the first net buffer exists before trying to copy it.

Found using WDK 10 static code analysis.

Signed-off-by: Alin Gabriel Serdean <aserdean at cloudbasesolutions.com>
---
 datapath-windows/ovsext/BufferMgmt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/datapath-windows/ovsext/BufferMgmt.c b/datapath-windows/ovsext/BufferMgmt.c
index c81ca2a..d913380 100644
--- a/datapath-windows/ovsext/BufferMgmt.c
+++ b/datapath-windows/ovsext/BufferMgmt.c
@@ -985,6 +985,9 @@ OvsFullCopyNBL(PVOID ovsContext,
     }

     nb = NET_BUFFER_LIST_FIRST_NB(nbl);
+    if (nb == NULL) {
+        return NULL;
+    }

     if (NET_BUFFER_NEXT_NB(nb) == NULL) {
         return OvsCopySinglePacketNBL(context, nbl, nb, headRoom, copyNblInfo);
--
2.10.2.windows.1
_______________________________________________

Acked-by: Shashank Ram <rams at vmware.com>


More information about the dev mailing list