[PATCH nft] rule: crash when uncollapsing command with unexisting table or set

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

 



If ruleset update refers to an unexisting table or set, then
cmd->elem.set is NULL.

Fixes: 498a5f0c219d ("rule: collapse set element commands")
Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
---
 src/rule.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/rule.c b/src/rule.c
index 79d4b77756e4..9c9eaec0c77b 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -1453,7 +1453,9 @@ void nft_cmd_uncollapse(struct list_head *cmds)
 		}
 
 		list_for_each_entry_safe(collapse_cmd, collapse_cmd_next, &cmd->collapse_list, list) {
-			collapse_cmd->elem.set = set_get(cmd->elem.set);
+			if (cmd->elem.set)
+				collapse_cmd->elem.set = set_get(cmd->elem.set);
+
 			list_add(&collapse_cmd->list, &cmd->list);
 		}
 	}
-- 
2.30.2




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux