From 6cdb362a88ebaf2bacd8ceac92f407b3d838203a Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Fri, 27 May 2011 20:52:06 +0200 Subject: Fix long time uncovered bug at adding string attributes to the netlink message Use the real string length instead of the maximum one when adding the attribute. --- lib/session.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/session.c b/lib/session.c index 0e05f28..c03ed5d 100644 --- a/lib/session.c +++ b/lib/session.c @@ -1453,6 +1453,9 @@ rawdata2attr(struct ipset_session *session, struct nlmsghdr *nlh, return 1; switch (attr->type) { + case MNL_TYPE_NUL_STRING: + alen = strlen((const char *)d) + 1; + break; case MNL_TYPE_U32: { uint32_t value = htonl(*(const uint32_t *)d); -- cgit v1.2.3