1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-08-30 05:50:12 +03:00

dhcp4: use memdup_suffix0() instead of strndup() for binary data

C.f. ac0a94f743.

Fixes #12693.
This commit is contained in:
Yu Watanabe
2019-05-30 10:32:36 +09:00
committed by Zbigniew Jędrzejewski-Szmek
parent d8f8b18cdb
commit ea082dda71

View File

@ -333,7 +333,7 @@ static int lease_parse_string(const uint8_t *option, size_t len, char **ret) {
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;