Maat_rule_get_ex_data读取compile rule的exdata时,对scanner判空,避免无配置时发生段错误。 修复 TSG-9349

This commit is contained in:
zhengchao
2022-01-12 10:43:46 +05:00
parent 65712be21c
commit d2db95e528
3 changed files with 5 additions and 2 deletions

View File

@@ -1146,6 +1146,10 @@ MAAT_RULE_EX_DATA Maat_rule_get_ex_data(Maat_feather_t feather, const struct Maa
const struct compile_table_schema* compile_desc=NULL;
const struct compile_ex_data_idx* ex_desc=NULL;
MAAT_RULE_EX_DATA ad=NULL;
if(!_feather || !_feather->scanner)
{
return NULL;
}
compile=(struct Maat_compile_rule*)Maat_hierarchy_compile_read_user_data(_feather->scanner->hier, rule->config_id);
if(compile==NULL)
{

View File

@@ -57,7 +57,7 @@ extern "C"
}
#endif
int MAAT_FRAME_VERSION_3_5_1_20211024=1;
int MAAT_FRAME_VERSION_3_5_2_20220112=1;
int is_valid_table_name(const char* str)
{

View File

@@ -1231,7 +1231,6 @@ TEST(NOTLogic, ScanHitAtLastEmptyExpr)
TEST(NOTLogic, ScanHitAtLastEmptyInteger)
{
const char* string_should_not_hit="This string should not hit.";
const char* string_match_no_region="This string is matched against a empty table.";
int ret=0;
int table_id=0;
struct Maat_rule_t result[4];