1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +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);