From: David Lamparter Date: Wed, 22 Jan 2025 10:15:17 +0000 (+0100) Subject: fpm: guard against garbage in unused address bytes X-Git-Tag: docker/10.1.3~23^2~4 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=8b89837c99ec33732b829788f66cceebf8273ec1;p=mirror%2Ffrr.git fpm: guard against garbage in unused address bytes Zero out the 12 unused bytes (for the IPv6 address) when reading in an IPv4 address. Signed-off-by: David Lamparter (cherry picked from commit 95cf0b227980999e2af22a2c171e5237e5ffca8e) --- diff --git a/fpm/fpm_pb.h b/fpm/fpm_pb.h index 23d7e43993..8847365a37 100644 --- a/fpm/fpm_pb.h +++ b/fpm/fpm_pb.h @@ -111,6 +111,7 @@ static inline int fpm__nexthop__get(const Fpm__Nexthop *nh, nexthop->vrf_id = VRF_DEFAULT; nexthop->type = NEXTHOP_TYPE_IPV4; + memset(&nexthop->gate, 0, sizeof(nexthop->gate)); nexthop->gate.ipv4 = ipv4; if (ifindex) { nexthop->type = NEXTHOP_TYPE_IPV4_IFINDEX;