Skip to content

Commit a738bfa

Browse files
tomi-fonthenrikbrixandersen
authored andcommitted
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 <[email protected]>
1 parent d1da071 commit a738bfa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

subsys/net/l2/ppp/ipv6cp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ static int ipv6cp_add_iid(struct ppp_context *ctx, struct net_pkt *pkt)
3737
if (linkaddr->len == 8) {
3838
memcpy(iid, linkaddr->addr, iid_len);
3939
} else {
40+
NET_ASSERT(linkaddr->len >= 6);
4041
memcpy(iid, linkaddr->addr, 3);
4142
iid[3] = 0xff;
4243
iid[4] = 0xfe;

0 commit comments

Comments
 (0)