chiark / gitweb /
sd-rtnl: fix size check in sd_rtnl_message_append_string()
[elogind.git] / src / libsystemd / sd-rtnl / rtnl-message.c
index 5c627f9..165e84d 100644 (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);