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;
|
||||
|
||||
if (size) {
|
||||
length = strnlen(data, size);
|
||||
if (length >= size)
|
||||
length = strnlen(data, size+1);
|
||||
if (length > size)
|
||||
return -EINVAL;
|
||||
} else
|
||||
length = strlen(data);
|
||||
|
Loading…
Reference in New Issue
Block a user