From 6f6f34f620a18638eb820a9ab3d8a93e350d722a Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Mon, 8 Aug 2016 13:05:31 -0400 Subject: VPP-189 Clean up more coverity warnings Change-Id: If66713d79c545c762c385faf08cc809347741152 Signed-off-by: Dave Barach --- vpp/vpp-api/api.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'vpp/vpp-api/api.c') diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c index bed280a1..18063acc 100644 --- a/vpp/vpp-api/api.c +++ b/vpp/vpp-api/api.c @@ -2588,9 +2588,11 @@ vl_api_sw_interface_clear_stats_t_handler (vl_api_sw_interface_clear_stats_t * vlib_combined_counter_main_t *cm; static vnet_main_t **my_vnet_mains; int i, j, n_counters; - int rv = 0; + if (mp->sw_if_index != ~0) + VALIDATE_SW_IF_INDEX(mp); + vec_reset_length (my_vnet_mains); for (i = 0; i < vec_len (vnet_mains); i++) @@ -2632,6 +2634,8 @@ vl_api_sw_interface_clear_stats_t_handler (vl_api_sw_interface_clear_stats_t * } } + BAD_SW_IF_INDEX_LABEL; + REPLY_MACRO (VL_API_SW_INTERFACE_CLEAR_STATS_REPLY); } @@ -7768,6 +7772,8 @@ vl_api_ipfix_dump_t_handler (vl_api_ipfix_dump_t * mp) vl_api_ipfix_details_t *rmp; q = vl_api_client_index_to_input_queue (mp->client_index); + if (!q) + return; rmp = vl_msg_api_alloc (sizeof (*rmp)); memset (rmp, 0, sizeof (*rmp)); @@ -7919,8 +7925,7 @@ static void } // Validate mask_length - if (mask_length < 0 || - (is_ipv6 && mask_length > 128) || (!is_ipv6 && mask_length > 32)) + if ((is_ipv6 && mask_length > 128) || (!is_ipv6 && mask_length > 32)) { rv = VNET_API_ERROR_ADDRESS_LENGTH_MISMATCH; goto reply; -- cgit 1.2.3-korg