From 2d77b9c88d951171354c398cb363c04f4e782f91 Mon Sep 17 00:00:00 2001 From: Zheng Chao Date: Mon, 1 Jul 2024 14:48:29 +0800 Subject: When removing group from a clause, and the clause is empty, the clause id should be cleared. --- src/maat_compile.c | 1 + test/maat_framework_gtest.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/maat_compile.c b/src/maat_compile.c index 3849082..bac613a 100644 --- a/src/maat_compile.c +++ b/src/maat_compile.c @@ -888,6 +888,7 @@ static void maat_compile_clause_remove_literal(struct maat_compile *compile, compile_clause_remove_literal(clause, g2c_item); if (0 == utarray_len(clause->literals)) { clause->in_use = 0; + clause->clause_id = 0; compile->actual_clause_num--; } } diff --git a/test/maat_framework_gtest.cpp b/test/maat_framework_gtest.cpp index 92669ae..7a9ee88 100644 --- a/test/maat_framework_gtest.cpp +++ b/test/maat_framework_gtest.cpp @@ -3124,6 +3124,7 @@ TEST_F(IPScan, RuleUpdates) { } TEST_F(IPScan, RuleChangeClauseId) { + //This test is a reproduce of bug OMPUB-1343. const char *src_table_name = "VIRTUAL_IP_PLUS_SOURCE"; const char *dst_table_name = "VIRTUAL_IP_PLUS_DESTINATION"; const char *phy_ip_table_name = "IP_PLUS_CONFIG"; -- cgit v1.2.3