mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-22 13:33:56 +03:00
sd-lldp: use memcpy_safe() as the buffer size may be zero
(cherry picked from commit 87bd4b79e6
)
This commit is contained in:
parent
073eba2319
commit
5e069e405a
@ -652,7 +652,8 @@ int sd_lldp_neighbor_from_raw(sd_lldp_neighbor **ret, const void *raw, size_t ra
|
|||||||
if (!n)
|
if (!n)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
memcpy(LLDP_NEIGHBOR_RAW(n), raw, raw_size);
|
memcpy_safe(LLDP_NEIGHBOR_RAW(n), raw, raw_size);
|
||||||
|
|
||||||
r = lldp_neighbor_parse(n);
|
r = lldp_neighbor_parse(n);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
Loading…
Reference in New Issue
Block a user