Skip to content

Commit defb8f3

Browse files
dbosoft-fwaserdean
authored andcommitted
datapath-windows: Fix possible null reference in _MapNlAttrToOvsPktExec
It can happen that ovs key attributes are not in keyAttrs of port. In this case the call of NlAttrGetU32 will cause a BSOD in Release builds. Signed-off-by: Frank Wagner <frank.wagner@dbosoft.eu> Reviewed-by: Mike Pattrick <mkp@redhat.com> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
1 parent 69f0acc commit defb8f3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

datapath-windows/ovsext/User.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,10 @@ _MapNlAttrToOvsPktExec(PNL_MSG_HDR nlMsgHdr, PNL_ATTR *nlAttrs,
406406
execute->actions = NlAttrGet(nlAttrs[OVS_PACKET_ATTR_ACTIONS]);
407407
execute->actionsLen = NlAttrGetSize(nlAttrs[OVS_PACKET_ATTR_ACTIONS]);
408408

409-
ASSERT(keyAttrs[OVS_KEY_ATTR_IN_PORT]);
410-
execute->inPort = NlAttrGetU32(keyAttrs[OVS_KEY_ATTR_IN_PORT]);
409+
//TODO revisit and understand if this check is needed
410+
if (keyAttrs[OVS_KEY_ATTR_IN_PORT]) {
411+
execute->inPort = NlAttrGetU32(keyAttrs[OVS_KEY_ATTR_IN_PORT]);
412+
}
411413
execute->keyAttrs = keyAttrs;
412414

413415
if (nlAttrs[OVS_PACKET_ATTR_MRU]) {

0 commit comments

Comments
 (0)