diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-06-19 14:15:06 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-06-19 14:15:42 +0900 |
commit | 79cd22d6f389c3ee6d711a4c54dc39d3ce6a8c79 (patch) | |
tree | 4fa6684a26dee530a5eb0e5395c8ad134372f965 | |
parent | d9adc8a8636f48e7f33371fc97cf9388744ff3a1 (diff) | |
download | systemd-79cd22d6f389c3ee6d711a4c54dc39d3ce6a8c79.tar.gz |
dhcp: use memdup_suffix0() instead of strndup()
-rw-r--r-- | src/libsystemd-network/dhcp-option.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-network/dhcp-option.c b/src/libsystemd-network/dhcp-option.c index a68de4ff98..0abb8fdef0 100644 --- a/src/libsystemd-network/dhcp-option.c +++ b/src/libsystemd-network/dhcp-option.c @@ -198,7 +198,7 @@ static int parse_options(const uint8_t options[], size_t buflen, uint8_t *overlo if (memchr(option, 0, len - 1)) return -EINVAL; - string = strndup((const char *) option, len); + string = memdup_suffix0((const char *) option, len); if (!string) return -ENOMEM; |