summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVladimir Isaev <visaev@netgate.com>2020-09-23 14:39:17 +0300
committerMatthew Smith <mgsmith@netgate.com>2020-09-23 13:31:05 +0000
commite85aa4c46aab9ddd0824c455b3d18460e5213f79 (patch)
tree06a168c4bab82bebc5885a8a1493a6c1903e29c2 /src
parentd63f73b8393b086d21a5197d1e02fac243867a93 (diff)
lldp: fix format string for hw->name
Sanitizer found it. hw->name is not null terminated vector. So use '%v' for it. Type: fix Signed-off-by: Vladimir Isaev <visaev@netgate.com> Change-Id: Idea16b33d33b371f5b6f6ab403edd0b4860c95f2
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lldp/lldp_cli.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/lldp/lldp_cli.c b/src/plugins/lldp/lldp_cli.c
index 2a0891a2e48..0d196f4e394 100644
--- a/src/plugins/lldp/lldp_cli.c
+++ b/src/plugins/lldp/lldp_cli.c
@@ -554,7 +554,7 @@ format_lldp_intfs_detail (u8 * s, vlib_main_t * vm, const lldp_main_t * lm)
hw = vnet_get_hw_interface(vnm, n->hw_if_index);
sw = vnet_get_sw_interface(lm->vnet_main, hw->sw_if_index);
- s = format(s, "\nLocal Interface name: %s\n"
+ s = format(s, "\nLocal Interface name: %v\n"
"Local Port Description: %s\n",
hw->name, n->port_desc);
if (n->mgmt_ip4)
@@ -643,7 +643,7 @@ format_lldp_intfs (u8 * s, va_list * va)
continue;
if (now < n->last_heard + n->ttl)
{
- s = format(s, "%-25s %-25U %-25U %=15U %=15U %=10s\n", hw->name,
+ s = format(s, "%-25v %-25U %-25U %=15U %=15U %=10s\n", hw->name,
format_lldp_chassis_id, n->chassis_id_subtype,
n->chassis_id, vec_len(n->chassis_id), 0,
format_lldp_port_id, n->port_id_subtype, n->port_id,
@@ -652,7 +652,7 @@ format_lldp_intfs (u8 * s, va_list * va)
}
else
{
- s = format(s, "%-25s %-25s %-25s %=15U %=15U %=10s\n", hw->name,
+ s = format(s, "%-25v %-25s %-25s %=15U %=15U %=10s\n", hw->name,
"", "", format_time_ago, n->last_heard, now,
format_time_ago, n->last_sent, now, "inactive");
}