]> git.ipfire.org Git - thirdparty/iptables.git/commit
libiptc: Fix for segfault when renaming a chain
authorPhil Sutter <phil@nwl.cc>
Fri, 7 Oct 2022 16:29:07 +0000 (18:29 +0200)
committerPhil Sutter <phil@nwl.cc>
Fri, 7 Oct 2022 21:03:42 +0000 (23:03 +0200)
commit97bf4e68fc0794adba3243fd96f40f4568e7216f
treea418bb94933cd2e17119892f1d17e4f8eaf25857
parent28c7bf020e9b1dcf94bd3162ce9c354c06bb6f97
libiptc: Fix for segfault when renaming a chain

This is an odd bug: If the number of chains is right and one renames the
last one in the list, libiptc dereferences a NULL pointer. Add fix and
test case for it.

Fixes: 64ff47cde38e4 ("libiptc: fix chain rename bug in libiptc")
Reported-by: Julien Castets <castets.j@gmail.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/tests/shell/testcases/chain/0006rename-segfault_0 [new file with mode: 0755]
libiptc/libiptc.c