summaryrefslogtreecommitdiffstats
path: root/include/utils.h
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2021-06-14 14:47:47 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2021-06-14 19:24:44 +0200
commitb0e7b294224030abc534c396fffcab9fbce12b11 (patch)
treeba559c1d0427491d7073d8d2ffa12472c6d41636 /include/utils.h
parent4971686bd77973310d20a5c700115f5d28e752d3 (diff)
src: add xzalloc_array() and use it to allocate the expression hashtable
Otherwise, assertion to ensure that no colission occur is hit due to uninitialized hashtable memory area: nft: netlink_delinearize.c:1741: expr_handler_init: Assertion `expr_handle_ht[hash] == NULL' failed. Fixes: c4058f96c6a5 ("netlink_delinearize: Fix suspicious calloc() call") Acked-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/utils.h')
-rw-r--r--include/utils.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/utils.h b/include/utils.h
index f45f2513..ffbe2cbb 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -133,6 +133,7 @@ extern void *xmalloc(size_t size);
extern void *xmalloc_array(size_t nmemb, size_t size);
extern void *xrealloc(void *ptr, size_t size);
extern void *xzalloc(size_t size);
+extern void *xzalloc_array(size_t nmemb, size_t size);
extern char *xstrdup(const char *s);
extern void xstrunescape(const char *in, char *out);