From: Andrew Yourtchenko Date: Mon, 25 Sep 2017 16:37:28 +0000 (+0200) Subject: acl-plugin: use vec_elt_at_index rather than pool_elt_at_index to access vector elements X-Git-Tag: v17.10-rc1~23 X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=commitdiff_plain;h=95524c3a2ed435bf05781a8c052305a6327c90b0 acl-plugin: use vec_elt_at_index rather than pool_elt_at_index to access vector elements bb7f0f644 aimed to fix the coverity issue has incorrectly replaced the previous [] access with pool_elt_at_index(), for an element of a vector, with predictably interesting result. VPP-991 has uncovered the issue. Change-Id: Ifd3fb70332d3fdd1c4ff8570372f394913f7b6c8 Signed-off-by: Andrew Yourtchenko --- diff --git a/src/plugins/acl/acl.c b/src/plugins/acl/acl.c index 41616975de8..9e029e62e46 100644 --- a/src/plugins/acl/acl.c +++ b/src/plugins/acl/acl.c @@ -259,13 +259,13 @@ acl_del_list (u32 acl_list_index) } if (acl_list_index < vec_len(am->input_sw_if_index_vec_by_acl)) { - if (vec_len(pool_elt_at_index(am->input_sw_if_index_vec_by_acl, acl_list_index)) > 0) { + if (vec_len(vec_elt_at_index(am->input_sw_if_index_vec_by_acl, acl_list_index)) > 0) { /* ACL is applied somewhere inbound. Refuse to delete */ return -1; } } if (acl_list_index < vec_len(am->output_sw_if_index_vec_by_acl)) { - if (vec_len(pool_elt_at_index(am->output_sw_if_index_vec_by_acl, acl_list_index)) > 0) { + if (vec_len(vec_elt_at_index(am->output_sw_if_index_vec_by_acl, acl_list_index)) > 0) { /* ACL is applied somewhere outbound. Refuse to delete */ return -1; }