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
1 changed files with 2 additions and 2 deletions

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