From: Harald Welte Date: Fri, 21 Apr 2006 11:56:30 +0000 (+0000) Subject: cmdflags is used in cmd2char() to return the option for a command. It uses the X-Git-Tag: v1.3.6~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0eca33f8a830d1aaca53b590abe791109a9524e3;p=thirdparty%2Fiptables.git cmdflags is used in cmd2char() to return the option for a command. It uses the bit position of the command mask as an index in the array. There's no entry for CMD_CHECK (0x0800U), so lookups for CMD_RENAME_CHAIN (0x1000U) index outside the array. (Closes: #463) --- diff --git a/ip6tables.c b/ip6tables.c index a375a2e9..ae3cb621 100644 --- a/ip6tables.c +++ b/ip6tables.c @@ -81,8 +81,7 @@ #define CMD_NEW_CHAIN 0x0100U #define CMD_DELETE_CHAIN 0x0200U #define CMD_SET_POLICY 0x0400U -#define CMD_CHECK 0x0800U -#define CMD_RENAME_CHAIN 0x1000U +#define CMD_RENAME_CHAIN 0x0800U #define NUMBER_OF_CMD 13 static const char cmdflags[] = { 'I', 'D', 'D', 'R', 'A', 'L', 'F', 'Z', 'N', 'X', 'P', 'E' }; diff --git a/iptables.c b/iptables.c index e79d64f1..4cb9ae4d 100644 --- a/iptables.c +++ b/iptables.c @@ -79,8 +79,7 @@ #define CMD_NEW_CHAIN 0x0100U #define CMD_DELETE_CHAIN 0x0200U #define CMD_SET_POLICY 0x0400U -#define CMD_CHECK 0x0800U -#define CMD_RENAME_CHAIN 0x1000U +#define CMD_RENAME_CHAIN 0x0800U #define NUMBER_OF_CMD 13 static const char cmdflags[] = { 'I', 'D', 'D', 'R', 'A', 'L', 'F', 'Z', 'N', 'X', 'P', 'E' };