ethernet: fix dmac filter coverity warning 92/22492/2
authorMatthew Smith <mgsmith@netgate.com>
Wed, 2 Oct 2019 21:34:27 +0000 (16:34 -0500)
committerDamjan Marion <dmarion@me.com>
Thu, 3 Oct 2019 12:41:06 +0000 (12:41 +0000)
Static analysis says that a possibly null pointer is dereferenced.
Check it first.

Type: fix

Change-Id: I3d1a1548162d1dfc26f19fbcf159f0f1f91eb7c4
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
src/vnet/ethernet/node.c

index 488218e..9c9143d 100755 (executable)
@@ -859,7 +859,7 @@ eth_input_process_frame (vlib_main_t * vm, vlib_node_runtime_t * node,
 
   if (dmac_check)
     {
-      if (vec_len (ei->secondary_addrs))
+      if (ei && vec_len (ei->secondary_addrs))
        eth_input_process_frame_dmac_check (hi, dmacs, dmacs_bad, n_packets,
                                            ei, 1 /* have_sec_dmac */ );
       else