From 98a217f0d074d43b37f7e255274edd22bc202c87 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 20 Mar 2018 18:48:12 -0400 Subject: [PATCH] zebra: Ensure that we properly decode the zapi_route sent to us Ensure that we have properly decoded the zapi_route sent to us and if we cannot decode, log and move on. Signed-off-by: Donald Sharp --- zebra/zserv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zebra/zserv.c b/zebra/zserv.c index fc23d4e0dd..2d68fcde87 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -1168,7 +1168,12 @@ static void zread_route_add(ZAPI_HANDLER_ARGS) struct ipaddr vtep_ip; s = msg; - zapi_route_decode(s, &api); + if (zapi_route_decode(s, &api) < 0) { + if (IS_ZEBRA_DEBUG_RECV) + zlog_debug("%s: Unable to decode zapi_route sent", + __PRETTY_FUNCTION__); + return; + } if (IS_ZEBRA_DEBUG_RECV) { char buf_prefix[PREFIX_STRLEN]; -- 2.39.5