From ddb070e8b1481cf9db77bc269d9d9754958a213b Mon Sep 17 00:00:00 2001 From: Vladimir Isaev Date: Fri, 18 Sep 2020 14:43:29 +0300 Subject: tap: do not use strlen on vector sanitizer complains about strlen on hi->name in tap_dump_ifs. hi->name is a vector which is not null-terminated, so use vec_len. Type: fix Signed-off-by: Vladimir Isaev Change-Id: Icdd5f65369bb51b0c4a9cd86c24899e6febd837c (cherry picked from commit 84f3d9fba4e1715237a41f0978430193363187c7) --- src/vnet/devices/tap/tap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/vnet/devices') diff --git a/src/vnet/devices/tap/tap.c b/src/vnet/devices/tap/tap.c index bc2bf56cab3..040ec1f1ea5 100644 --- a/src/vnet/devices/tap/tap.c +++ b/src/vnet/devices/tap/tap.c @@ -944,8 +944,7 @@ tap_dump_ifs (tap_interface_details_t ** out_tapids) tapid->sw_if_index = vif->sw_if_index; hi = vnet_get_hw_interface (vnm, vif->hw_if_index); clib_memcpy(tapid->dev_name, hi->name, - MIN (ARRAY_LEN (tapid->dev_name) - 1, - strlen ((const char *) hi->name))); + MIN (ARRAY_LEN (tapid->dev_name) - 1, vec_len (hi->name))); vring = vec_elt_at_index (vif->rxq_vrings, RX_QUEUE_ACCESS(0)); tapid->rx_ring_sz = vring->size; vring = vec_elt_at_index (vif->txq_vrings, TX_QUEUE_ACCESS(0)); -- cgit 1.2.3-korg