summaryrefslogtreecommitdiffstats
path: root/lib/session.c
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2011-05-27 20:52:06 +0200
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2011-05-27 20:52:06 +0200
commit6cdb362a88ebaf2bacd8ceac92f407b3d838203a (patch)
treea28e77730afc5084b7afaba7c4a88e6e0ece24e5 /lib/session.c
parent671b9320d57ea13196717ef3a68fd6881475c0d9 (diff)
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.
Diffstat (limited to 'lib/session.c')
-rw-r--r--lib/session.c3
1 files changed, 3 insertions, 0 deletions
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);