linux-cp: fix name formatting 99/35799/2
authorDmitry Valter <d-valter@yandex-team.ru>
Sat, 26 Mar 2022 17:42:25 +0000 (17:42 +0000)
committerDamjan Marion <dmarion@me.com>
Sun, 27 Mar 2022 09:21:06 +0000 (09:21 +0000)
Format host interface name as vector rather than c-string.
Otherwise non-null-terminated vector overrun triggers ASAN.

Type: fix
Fixes: 1705a6baefe205bb6792b547c7376eee3f328a71
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: Ib204e57ee17c7ed3bfeb568dcdd834d7d7519102

src/plugins/linux-cp/lcp_interface.c

index 142ac50..bcd8ac7 100644 (file)
@@ -410,7 +410,7 @@ lcp_itf_pair_del (u32 phy_sw_if_index)
   lip = lcp_itf_pair_get (lipi);
 
   LCP_ITF_PAIR_NOTICE (
-    "pair_del: host:%U phy:%U host_if:%s vif:%d ns:%s",
+    "pair_del: host:%U phy:%U host_if:%v vif:%d ns:%v",
     format_vnet_sw_if_index_name, vnet_get_main (), lip->lip_host_sw_if_index,
     format_vnet_sw_if_index_name, vnet_get_main (), lip->lip_phy_sw_if_index,
     lip->lip_host_name, lip->lip_vif_index, lip->lip_namespace);