]> git.ipfire.org Git - thirdparty/libnl.git/commitdiff
idiag: fix out of bound error parsing idiag messages
authorThomas Haller <thaller@redhat.com>
Mon, 24 Nov 2014 16:14:46 +0000 (17:14 +0100)
committerThomas Haller <thaller@redhat.com>
Mon, 24 Nov 2014 17:30:21 +0000 (18:30 +0100)
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
lib/idiag/idiag_msg_obj.c

index f1b5e2827df5beef23c1fe2b304783ac07b6e83c..b6f55c8860fa04b8d1846396f5118ead06c32eec 100644 (file)
@@ -603,7 +603,7 @@ int idiagnl_msg_parse(struct nlmsghdr *nlh, struct idiagnl_msg **result)
        if (!msg)
                goto errout_nomem;
 
-       err = nlmsg_parse(nlh, sizeof(struct inet_diag_msg), tb, IDIAG_ATTR_MAX,
+       err = nlmsg_parse(nlh, sizeof(struct inet_diag_msg), tb, IDIAG_ATTR_MAX - 1,
                        ext_policy);
        if (err < 0)
                goto errout;