[systemd-commits] src/libsystemd
Lennart Poettering
lennart at kemper.freedesktop.org
Mon Dec 8 16:09:34 PST 2014
src/libsystemd/sd-rtnl/rtnl-message.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 3072eecf3c714e3ed88c882623c40aca15445f64
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Dec 9 01:09:21 2014 +0100
sd-rtnl: fix size check in sd_rtnl_message_append_string()
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
index 5c627f9..165e84d 100644
--- a/src/libsystemd/sd-rtnl/rtnl-message.c
+++ b/src/libsystemd/sd-rtnl/rtnl-message.c
@@ -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);
More information about the systemd-commits
mailing list