From af494b6878ed605e3b52d13e6aba023f3cd985ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Falgueras=20Garc=C3=ADa?= Date: Mon, 15 Aug 2016 12:51:03 +0200 Subject: expr: cmp: Use cmp2str() instead of directly access to array MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Uses cmp2str() which checks array bounds. Signed-off-by: Carlos Falgueras GarcĂ­a Signed-off-by: Pablo Neira Ayuso --- src/expr/cmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/expr/cmp.c b/src/expr/cmp.c index f3dd62c..5d51958 100644 --- a/src/expr/cmp.c +++ b/src/expr/cmp.c @@ -267,7 +267,7 @@ static int nftnl_expr_cmp_snprintf_default(char *buf, size_t size, int len = size, offset = 0, ret; ret = snprintf(buf, len, "%s reg %u ", - expr_cmp_str[cmp->op], cmp->sreg); + cmp2str(cmp->op), cmp->sreg); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); ret = nftnl_data_reg_snprintf(buf+offset, len, &cmp->data, -- cgit v1.2.3