diff mbox

[ovs-dev,10/40] datapath-windows: Fix possible NULL deference

Message ID BY2PR0501MB2119C9A1238F30ED6080504BA2AD0@BY2PR0501MB2119.namprd05.prod.outlook.com
State Not Applicable
Headers show

Commit Message

Shashank Ram July 14, 2017, 4:45 p.m. UTC

diff mbox

Patch

diff --git a/datapath-windows/ovsext/Actions.c b/datapath-windows/ovsext/Actions.c
index ebe8264..39539e0 100644
--- a/datapath-windows/ovsext/Actions.c
+++ b/datapath-windows/ovsext/Actions.c
@@ -1244,6 +1244,10 @@  OvsActionMplsPush(OvsForwardingContext *ovsFwdCtx,
     ASSERT(mdlLen >= MPLS_HLEN);

     ethHdr = (EthHdr *)(bufferStart + curMdlOffset);
+    if (!ethHdr) {
+        ovsActionStats.noResource++;
+        return NDIS_STATUS_RESOURCES;

NDIS_STATUS_RESOURCES is returned typically to return an error indicating insufficient resources. Under what cases will the ethHdr be NULL? Maybe for an invalid packet? 

+    }