]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: Ensure that we properly decode the zapi_route sent to us
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 20 Mar 2018 22:48:12 +0000 (18:48 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 20 Mar 2018 22:48:12 +0000 (18:48 -0400)
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 <sharpd@cumulusnetworks.com>
zebra/zserv.c

index fc23d4e0dd024474bc89ff94db9e717fb1fc941d..2d68fcde8702003c5345914bc78b2c0a8faa4d84 100644 (file)
@@ -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];