summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-11-18 05:28:27 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-11-18 20:04:14 +0100
commitc8ddd5ff72453876b360e7580cc386945b79f5e9 (patch)
tree1619e5800f21ccb4c9291aaea0a05f2c8f247cdf
parentukify: fix parsing of SignTool configuration option (diff)
downloadsystemd-c8ddd5ff72453876b360e7580cc386945b79f5e9.tar.xz
systemd-c8ddd5ff72453876b360e7580cc386945b79f5e9.zip
ndisc-option: use memcpy_safe() at one more place
As 'len' may be 8. Follow-up for a163404cc88914142ef8bbfaab0eb39d1a990c02.
-rw-r--r--src/libsystemd-network/ndisc-option.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-network/ndisc-option.c b/src/libsystemd-network/ndisc-option.c
index d784ffb3ff..3aab51f51b 100644
--- a/src/libsystemd-network/ndisc-option.c
+++ b/src/libsystemd-network/ndisc-option.c
@@ -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);