From a357a938019c8df2b061cc5bd14cd8a64fac694f Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Fri, 14 Feb 2020 07:32:54 -0500 Subject: vrrp dns: fix coverity warnings Type: fix Ticket: VPP-1837 Signed-off-by: Dave Barach Change-Id: I0d164147173b452fee7e720e01e6a9991f43b64a --- src/plugins/dns/dns.c | 2 +- src/plugins/vrrp/node.c | 3 ++- src/plugins/vrrp/vrrp_api.c | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/dns/dns.c b/src/plugins/dns/dns.c index 4a07fc09a6d..bdf14961a78 100644 --- a/src/plugins/dns/dns.c +++ b/src/plugins/dns/dns.c @@ -2757,7 +2757,7 @@ vnet_send_dns4_reply (dns_main_t * dm, dns_pending_request_t * pr, u8 *reply; vl_api_dns_resolve_name_reply_t _rnr, *rnr = &_rnr; vl_api_dns_resolve_ip_reply_t _rir, *rir = &_rir; - u32 ttl, tmp; + u32 ttl = 64, tmp; u32 qp_offset; dns_query_t *qp; dns_rr_t *rr; diff --git a/src/plugins/vrrp/node.c b/src/plugins/vrrp/node.c index b819919e428..34d082ec2ff 100644 --- a/src/plugins/vrrp/node.c +++ b/src/plugins/vrrp/node.c @@ -617,7 +617,8 @@ vrrp_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node, } /* Mandatory - packet must be complete */ - if (b0->current_length < sizeof (*vrrp0) + vrrp0->n_addrs * addr_len) + if (b0->current_length < sizeof (*vrrp0) + + ((u32) vrrp0->n_addrs) * addr_len) { error0 = VRRP_ERROR_INCOMPLETE_PKT; goto trace; diff --git a/src/plugins/vrrp/vrrp_api.c b/src/plugins/vrrp/vrrp_api.c index 3b9c256b263..d2badc0345b 100644 --- a/src/plugins/vrrp/vrrp_api.c +++ b/src/plugins/vrrp/vrrp_api.c @@ -211,6 +211,8 @@ vl_api_vrrp_vr_dump_t_handler (vl_api_vrrp_vr_dump_t * mp) u32 sw_if_index; reg = vl_api_client_index_to_registration (mp->client_index); + if (!reg) + return; sw_if_index = htonl (mp->sw_if_index); @@ -340,6 +342,8 @@ vl_api_vrrp_vr_peer_dump_t_handler (vl_api_vrrp_vr_peer_dump_t * mp) vrrp_vr_key_t vr_key; reg = vl_api_client_index_to_registration (mp->client_index); + if (!reg) + return; vr_key.sw_if_index = ntohl (mp->sw_if_index); @@ -456,6 +460,8 @@ vl_api_vrrp_vr_track_if_dump_t_handler (vl_api_vrrp_vr_track_if_dump_t * mp) vrrp_vr_t *vr; reg = vl_api_client_index_to_registration (mp->client_index); + if (!reg) + return; if (!mp->dump_all) { -- cgit 1.2.3-korg