ndisc-option: use memcpy_safe() at one more place

As 'len' may be 8.

Follow-up for a163404cc8.
This commit is contained in:
Yu Watanabe 2024-11-18 13:28:27 +09:00
parent 5e7e4e4d49
commit c8ddd5ff72

View File

@ -750,7 +750,7 @@ static int ndisc_option_parse_route(Set **options, size_t offset, size_t len, co
usec_t lifetime = unaligned_be32_sec_to_usec(opt + 4, /* max_as_infinity = */ true);
struct in6_addr prefix;
memcpy(&prefix, opt + 8, len - 8);
memcpy_safe(&prefix, opt + 8, len - 8);
in6_addr_mask(&prefix, prefixlen);
return ndisc_option_add_route(options, offset, preference, prefixlen, &prefix, lifetime);