From a738bfa7f42219487c5051eeae2a59de5ab9e283 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Tue, 6 Feb 2024 11:56:02 +0200 Subject: [PATCH] net: l2: ppp: ipv6cp: add assert to check the link address length This ensures that the configured link address is at least as big as the part of it that is used. Signed-off-by: Tomi Fontanilles --- subsys/net/l2/ppp/ipv6cp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/net/l2/ppp/ipv6cp.c b/subsys/net/l2/ppp/ipv6cp.c index aa261368f5..e18e54b393 100644 --- a/subsys/net/l2/ppp/ipv6cp.c +++ b/subsys/net/l2/ppp/ipv6cp.c @@ -37,6 +37,7 @@ static int ipv6cp_add_iid(struct ppp_context *ctx, struct net_pkt *pkt) if (linkaddr->len == 8) { memcpy(iid, linkaddr->addr, iid_len); } else { + NET_ASSERT(linkaddr->len >= 6); memcpy(iid, linkaddr->addr, 3); iid[3] = 0xff; iid[4] = 0xfe;