From f1b098b030e4b0a5a6c1f1f107d8951c0c8399cf Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Wed, 22 Jan 2025 11:15:17 +0100 Subject: [PATCH] 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) --- fpm/fpm_pb.h | 1 + 1 file changed, 1 insertion(+) 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; -- 2.39.5