linux-cp: fix possible null deref 32/34932/2
authorPim van Pelt <pim@ipng.nl>
Tue, 18 Jan 2022 13:30:52 +0000 (13:30 +0000)
committerMatthew Smith <mgsmith@netgate.com>
Tue, 18 Jan 2022 14:33:15 +0000 (14:33 +0000)
Found by coverity as defect id 243763

Signed-off-by: Pim van Pelt <pim@ipng.nl>
Type: fix
Change-Id: Idbada5528a1f2625f6498072d538edf306268b6d

src/plugins/linux-cp/lcp_interface_sync.c

index a4e343f..57a8e55 100644 (file)
@@ -46,6 +46,8 @@ lcp_itf_pair_sync_state (lcp_itf_pair_t *lip)
     return;
   sup_sw =
     vnet_get_sw_interface_or_null (vnet_get_main (), sw->sup_sw_if_index);
+  if (!sup_sw)
+    return;
 
   if (lip->lip_namespace)
     {