diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2011-05-27 20:52:06 +0200 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2011-05-27 20:52:06 +0200 |
commit | 6cdb362a88ebaf2bacd8ceac92f407b3d838203a (patch) | |
tree | a28e77730afc5084b7afaba7c4a88e6e0ece24e5 | |
parent | 671b9320d57ea13196717ef3a68fd6881475c0d9 (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.
-rw-r--r-- | lib/session.c | 3 |
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); |