mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
dhcp4: use memdup_suffix0() instead of strndup() for binary data
C.f. ac0a94f743.
Fixes #12693.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
d8f8b18cdb
commit
ea082dda71
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user