]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
libsystemd: fix RTNL_CONTAINER_DEPTH assert
authorKarel Zak <kzak@redhat.com>
Thu, 6 Aug 2015 11:32:07 +0000 (13:32 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 6 Aug 2015 11:33:53 +0000 (13:33 +0200)
The m->n_containers is index and has to be smaller than the array
size.

src/libsystemd/sd-netlink/netlink-message.c

index 3ba62a6be98e88284480b59fcf40b7174e8e640d..aee2ced2d93e1f43adedacc30d4707e3e043d7c8 100644 (file)
@@ -501,7 +501,7 @@ static int netlink_message_read_internal(sd_netlink_message *m, unsigned short t
         assert_return(m, -EINVAL);
         assert_return(m->sealed, -EPERM);
         assert_return(data, -EINVAL);
-        assert(m->n_containers <= RTNL_CONTAINER_DEPTH);
+        assert(m->n_containers < RTNL_CONTAINER_DEPTH);
         assert(m->containers[m->n_containers].attributes);
         assert(type < m->containers[m->n_containers].n_attributes);