1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

dhcp: use memdup_suffix0() instead of strndup()

This commit is contained in:
Yu Watanabe 2019-06-19 14:15:06 +09:00
parent d9adc8a863
commit 79cd22d6f3

View File

@ -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;