vrrp dns: fix coverity warnings
Type: fix
Ticket: VPP-1837
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I0d164147173b452fee7e720e01e6a9991f43b64a
diff --git a/src/plugins/dns/dns.c b/src/plugins/dns/dns.c
index 4a07fc0..bdf1496 100644
--- a/src/plugins/dns/dns.c
+++ b/src/plugins/dns/dns.c
@@ -2757,7 +2757,7 @@
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 b819919..34d082e 100644
--- a/src/plugins/vrrp/node.c
+++ b/src/plugins/vrrp/node.c
@@ -617,7 +617,8 @@
}
/* 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 3b9c256..d2badc0 100644
--- a/src/plugins/vrrp/vrrp_api.c
+++ b/src/plugins/vrrp/vrrp_api.c
@@ -211,6 +211,8 @@
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 @@
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 @@
vrrp_vr_t *vr;
reg = vl_api_client_index_to_registration (mp->client_index);
+ if (!reg)
+ return;
if (!mp->dump_all)
{