]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
*tables: Reject invalid chain names when renaming
authorPhil Sutter <phil@nwl.cc>
Fri, 21 Jul 2023 18:14:09 +0000 (20:14 +0200)
committerPhil Sutter <phil@nwl.cc>
Fri, 28 Jul 2023 12:27:15 +0000 (14:27 +0200)
While given chain name was sanity checked with --new-chain command,
--rename-chain command allowed to choose an invalid name. Keep things
consistent by adding the missing check.

Fixes: e6869a8f59d77 ("reorganized tree after kernel merge")
Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/xshared.c

index 28c65faed7b25f01ac9ea9e5e1717d96365d808e..5f75a0a57a023f55bf395f553c082e0c93675636 100644 (file)
@@ -1511,6 +1511,7 @@ void do_parse(int argc, char *argv[],
                                           "-%c requires old-chain-name and "
                                           "new-chain-name",
                                            cmd2char(CMD_RENAME_CHAIN));
+                       assert_valid_chain_name(p->newname);
                        break;
 
                case 'P':