region_rule_inner中增加magic_num,以诊断region配置删除时可能发生的野指针访问;同时hierarchy增加对region_id查找的判空,以避免在一个region扫描命中后,hierarchy中该region又被删除,产生的空指针访问。

This commit is contained in:
zhengchao
2020-07-06 16:46:41 +08:00
parent 639feb17b0
commit 41b3628b53
4 changed files with 13 additions and 2 deletions

View File

@@ -1052,6 +1052,12 @@ void Maat_hierarchy_compile_mid_udpate(struct Maat_hierarchy_compile_mid* mid, i
mid->this_scan_region_hit_cnt++;
pthread_rwlock_rdlock(&hier->rwlock);
HASH_FIND_INT(hier->hash_region_by_id, &region_id, region);
if(!region)
{
pthread_rwlock_unlock(&hier->rwlock);
return;
}
group=region->ref_parent_group;
if(group->top_group_cnt==0)