mirror of
https://github.com/systemd/systemd
synced 2024-09-06 16:56:43 +00:00
Merge pull request #12829 from yuwata/dhcp-memdup_suffix0
sd-bus,dhcp: use memdup_suffix0() instead of strndup()
This commit is contained in:
commit
a4eb991831
|
@ -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;
|
||||
|
||||
|
|
|
@ -5265,7 +5265,7 @@ int bus_message_parse_fields(sd_bus_message *m) {
|
|||
if (!b)
|
||||
return -EBADMSG;
|
||||
|
||||
sig = strndup(b+1, item_size - (b+1-(char*) q));
|
||||
sig = memdup_suffix0(b+1, item_size - (b+1-(char*) q));
|
||||
if (!sig)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
Loading…
Reference in a new issue