[PATCH 02/13] idiag: fix out of bound error parsing idiag messages

Thomas Haller thaller at redhat.com
Mon Nov 24 08:14:46 PST 2014


Signed-off-by: Thomas Haller <thaller at redhat.com>
---
 lib/idiag/idiag_msg_obj.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/idiag/idiag_msg_obj.c b/lib/idiag/idiag_msg_obj.c
index f1b5e28..b6f55c8 100644
--- a/lib/idiag/idiag_msg_obj.c
+++ b/lib/idiag/idiag_msg_obj.c
@@ -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;
-- 
1.9.3




More information about the libnl mailing list