mirror of
https://github.com/systemd/systemd.git
synced 2025-01-31 05:47:30 +03:00
ndisc-option: use memcpy_safe() at one more place
As 'len' may be 8. Follow-up for a163404cc88914142ef8bbfaab0eb39d1a990c02. (cherry picked from commit c8ddd5ff72453876b360e7580cc386945b79f5e9)
This commit is contained in:
parent
4a3d55a032
commit
7bb3040cc4
@ -737,7 +737,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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user