From 445995a8e270d6a7301fbc09b482d3e177172edb Mon Sep 17 00:00:00 2001 From: Alin Serdean Date: Fri, 14 Jul 2017 04:40:56 +0000 Subject: 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 Signed-off-by: Ben Pfaff Acked-by: Shashank Ram --- datapath-windows/ovsext/BufferMgmt.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'datapath-windows/ovsext/BufferMgmt.c') diff --git a/datapath-windows/ovsext/BufferMgmt.c b/datapath-windows/ovsext/BufferMgmt.c index 13eaf9529..1ede4a32e 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); -- cgit v1.2.1