diff mbox

[libnftables] ct: fix missing NFT_CT_L3PROTOCOL in ctkey2str_array

Message ID 20140115181846.25192.17850.stgit@nfdev.cica.es
State Accepted
Headers show

Commit Message

Arturo Borrero Jan. 15, 2014, 6:18 p.m. UTC
Due to missing NFT_CT_L3PROTOCOL key in ctkey2str_array, a segfault is
produced when the str2ctkey() loop reaches that position, since strcmp()
will try to compare a NULL value.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
 src/expr/ct.c |    1 +
 1 file changed, 1 insertion(+)


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Pablo Neira Ayuso Jan. 16, 2014, 5:51 p.m. UTC | #1
On Wed, Jan 15, 2014 at 07:18:46PM +0100, Arturo Borrero Gonzalez wrote:
> Due to missing NFT_CT_L3PROTOCOL key in ctkey2str_array, a segfault is
> produced when the str2ctkey() loop reaches that position, since strcmp()
> will try to compare a NULL value.

Good catch. Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/src/expr/ct.c b/src/expr/ct.c
index 97f9dcc..e960134 100644
--- a/src/expr/ct.c
+++ b/src/expr/ct.c
@@ -151,6 +151,7 @@  const char *ctkey2str_array[NFT_CT_MAX] = {
 	[NFT_CT_SECMARK]	= "secmark",
 	[NFT_CT_EXPIRATION]	= "expiration",
 	[NFT_CT_HELPER]		= "helper",
+	[NFT_CT_L3PROTOCOL]	= "l3protocol",
 	[NFT_CT_PROTOCOL]	= "protocol",
 	[NFT_CT_SRC]		= "src",
 	[NFT_CT_DST]		= "dst",