From bd9578d2dc1bf4ed587e0158b8f3c0753fd18f29 Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org" Date: Thu, 7 Jun 2007 15:37:44 +0000 Subject: fix nfct_snprintf behaviour if the buffer passed is too small (similar to C99 convention) --- include/internal.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/internal.h b/include/internal.h index a51e8b2..c512a85 100644 --- a/include/internal.h +++ b/include/internal.h @@ -158,6 +158,12 @@ static inline int test_bit(int nr, const u_int32_t *addr) return ((1UL << (nr & 31)) & (addr[nr >> 5])) != 0; } +#define BUFFER_SIZE(ret, size, len) \ + if (ret > len) \ + ret = len; \ + size += ret; \ + len -= ret; + int __build_conntrack(struct nfnl_subsys_handle *ssh, struct nfnlhdr *req, size_t size, u_int16_t type, u_int16_t flags, const struct nf_conntrack *ct); void __build_tuple(struct nfnlhdr *req, size_t size, const struct __nfct_tuple *t, const int type); int __parse_message_type(const struct nlmsghdr *nlh); -- cgit v1.2.3