1
0
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:
Lennart Poettering 2014-12-09 01:09:21 +01:00
parent 4a02e68602
commit 3072eecf3c

View File

@ -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);