From 456ded496f93eb8156dc6e7b5a81d4a3aa604f60 Mon Sep 17 00:00:00 2001 From: Eyal Bari Date: Sun, 22 Jul 2018 12:45:15 +0300 Subject: fix vector index range checks (VPP-1353) Change-Id: I63c36644c9d93f2c3ec6606ca0205b407499de4e Signed-off-by: Eyal Bari (cherry picked from commit cd30774fa9280736ffaea3e9a51948593e8eebc2) Signed-off-by: John Lo --- src/vnet/mpls/mpls_tunnel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vnet/mpls/mpls_tunnel.c') diff --git a/src/vnet/mpls/mpls_tunnel.c b/src/vnet/mpls/mpls_tunnel.c index a142edf3f0a..84d569bcfee 100644 --- a/src/vnet/mpls/mpls_tunnel.c +++ b/src/vnet/mpls/mpls_tunnel.c @@ -52,7 +52,7 @@ static const char *mpls_tunnel_attribute_names[] = MPLS_TUNNEL_ATTRIBUTES; static mpls_tunnel_t* mpls_tunnel_get_from_sw_if_index (u32 sw_if_index) { - if ((vec_len(mpls_tunnel_db) < sw_if_index) || + if ((vec_len(mpls_tunnel_db) <= sw_if_index) || (~0 == mpls_tunnel_db[sw_if_index])) return (NULL); -- cgit 1.2.3-korg