mirror of
https://github.com/systemd/systemd.git
synced 2024-11-02 02:21:44 +03:00
sd-rtnl: fix size check in sd_rtnl_message_append_string()
This commit is contained in:
parent
4a02e68602
commit
3072eecf3c
@ -700,8 +700,8 @@ int sd_rtnl_message_append_string(sd_rtnl_message *m, unsigned short type, const
|
|||||||
size = (size_t)r;
|
size = (size_t)r;
|
||||||
|
|
||||||
if (size) {
|
if (size) {
|
||||||
length = strnlen(data, size);
|
length = strnlen(data, size+1);
|
||||||
if (length >= size)
|
if (length > size)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
} else
|
} else
|
||||||
length = strlen(data);
|
length = strlen(data);
|
||||||
|
Loading…
Reference in New Issue
Block a user