]> git.ipfire.org Git - thirdparty/nftables.git/commit
netlink: Fix for potential NULL-pointer deref
authorPhil Sutter <phil@nwl.cc>
Tue, 10 Jan 2023 21:36:58 +0000 (22:36 +0100)
committerPhil Sutter <phil@nwl.cc>
Fri, 13 Jan 2023 16:11:18 +0000 (17:11 +0100)
commit927d5674e7bf656428f97c54c9171006e8c3c75e
tree0d5435ea9cefd280f5362029aeb883fbc7b6568c
parentd4d47e5bdf943be494aeb5d5a29b8f5212acbddf
netlink: Fix for potential NULL-pointer deref

If memory allocation fails, calloc() returns NULL which was not checked
for. The code seems to expect zero array size though, so simply
replacing this call by one of the x*calloc() ones won't work. So guard
the call also by a check for 'len'.

Fixes: db0697ce7f602 ("src: support for flowtable listing")
Signed-off-by: Phil Sutter <phil@nwl.cc>
src/netlink.c