[PATCH libnftnl] expr: data_reg: Fix DATA_CHAIN comparison

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Splits DATA_VERDICT and DATA_CHAIN comparison. A verdict can have a NULL
chain (accept, drop, etc) so segfault will happen when strcmp is call.

Signed-off-by: Carlos Falgueras García <carlosfg@xxxxxxxxxx>
---
 src/expr/data_reg.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/expr/data_reg.c b/src/expr/data_reg.c
index a954e95..395e9f6 100644
--- a/src/expr/data_reg.c
+++ b/src/expr/data_reg.c
@@ -387,6 +387,7 @@ bool nftnl_data_reg_cmp(const union nftnl_data_reg *r1,
 		return	r1->len == r2->len &&
 			!memcmp(r1->val, r2->val, r1->len);
 	case DATA_VERDICT:
+		return	r1->verdict == r2->verdict;
 	case DATA_CHAIN:
 		return	r1->verdict == r2->verdict &&
 			!strcmp(r1->chain, r2->chain);
-- 
2.9.3

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



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux