From ad4527eb61d1d5908fc9c62c5538df89b2df2f28 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Wed, 20 Sep 2017 00:02:50 -0300 Subject: [PATCH] zebra: fix uninitialized prefixes in the handling of FEC messages This was causing some weird prefixes to pop up in my log files. One alternate solution would be to call apply_mask() on the prefix, but memcpy() is faster and just enough in this case. Signed-off-by: Renato Westphal --- zebra/zserv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zebra/zserv.c b/zebra/zserv.c index fd2c5dd97c..f888207818 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -825,6 +825,7 @@ static int zserv_fec_register(struct zserv *client, int sock, u_short length) while (l < length) { flags = stream_getw(s); + memset(&p, 0, sizeof(p)); p.family = stream_getw(s); if (p.family != AF_INET && p.family != AF_INET6) { zlog_err( @@ -875,6 +876,7 @@ static int zserv_fec_unregister(struct zserv *client, int sock, u_short length) while (l < length) { // flags = stream_getw(s); (void)stream_getw(s); + memset(&p, 0, sizeof(p)); p.family = stream_getw(s); if (p.family != AF_INET && p.family != AF_INET6) { zlog_err( -- 2.39.5