From: Jozsef Kadlecsik Date: Fri, 27 May 2011 18:52:06 +0000 (+0200) Subject: Fix long time uncovered bug at adding string attributes to the netlink message X-Git-Tag: v6.7~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6cdb362a88ebaf2bacd8ceac92f407b3d838203a;p=ipset 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. --- 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);