diff --git a/src/entry/Maat_command.cpp b/src/entry/Maat_command.cpp index cbe7987..0e2b6d1 100644 --- a/src/entry/Maat_command.cpp +++ b/src/entry/Maat_command.cpp @@ -837,7 +837,7 @@ int build_serial_rule(_Maat_feather_t *feather,struct _Maat_cmd_inner_t* _cmd,st int rule_num=0,i=0,j=0; p_m_rule=&(cmd->compile); - char line[1024]; + char line[MAX_TABLE_LINE_SIZE]; time_t timeout=0; if(_cmd->cmd.expire_after>0) { diff --git a/src/entry/Maat_rule.cpp b/src/entry/Maat_rule.cpp index d22bf2c..04a7624 100644 --- a/src/entry/Maat_rule.cpp +++ b/src/entry/Maat_rule.cpp @@ -863,6 +863,17 @@ struct _Maat_compile_inner_t * create_compile_rule(int compile_id) pthread_rwlock_init(&(p->rwlock), NULL); return p; } +void force_destroy_compile_rule(struct _Maat_compile_inner_t * p) +{ + p->compile_id=-1; + dynamic_array_destroy(p->groups,NULL); + if(p->db_c_rule!=NULL) + { + free(p->db_c_rule); + } + pthread_rwlock_destroy(&(p->rwlock)); + free(p); +} void destroy_compile_rule(struct _Maat_compile_inner_t * p) { int i=0; @@ -873,14 +884,7 @@ void destroy_compile_rule(struct _Maat_compile_inner_t * p) p_group=(struct _Maat_compile_inner_t*)dynamic_array_read(p->groups,i); assert(p_group==NULL); } - p->compile_id=-1; - dynamic_array_destroy(p->groups,NULL); - if(p->db_c_rule!=NULL) - { - free(p->db_c_rule); - } - pthread_rwlock_destroy(&(p->rwlock)); - free(p); + force_destroy_compile_rule(p); } scan_rule_t* create_rs_str_rule(unsigned int sub_type,enum MAAT_MATCH_METHOD match_method,int is_case_sensitive,const char* string,int len,int l_offset,int r_offset) { @@ -1154,7 +1158,7 @@ void destroy_maat_scanner(struct _Maat_scanner_t*scanner) return; } rulescan_destroy(scanner->region); - MESA_htable_destroy(scanner->compile_hash,(void (*)(void*))destroy_compile_rule); + MESA_htable_destroy(scanner->compile_hash,(void (*)(void*))force_destroy_compile_rule); MESA_htable_destroy(scanner->group_hash, (void (*)(void*))force_destroy_group_rule); MESA_htable_destroy(scanner->region_hash, NULL); map_destroy(scanner->district_map); diff --git a/src/entry/Maat_rule_internal.h b/src/entry/Maat_rule_internal.h index 3e4d247..4f32373 100644 --- a/src/entry/Maat_rule_internal.h +++ b/src/entry/Maat_rule_internal.h @@ -40,7 +40,7 @@ typedef int atomic_t; #define MAX_CONJUNCTION_TABLE_NUM 8 #define MAX_CHARSET_NUM 16 #define MAX_TABLE_NAME_LEN 256 -#define MAX_TABLE_LINE_SIZE (1024*4) +#define MAX_TABLE_LINE_SIZE (1024*16) #define MAX_EXPR_KEYLEN 1024 #define MAX_DISTRICT_LEN 64 #define MAX_PLUGING_NUM 32 diff --git a/src/entry/config_monitor.cpp b/src/entry/config_monitor.cpp index 9a0b63b..54a0e7b 100644 --- a/src/entry/config_monitor.cpp +++ b/src/entry/config_monitor.cpp @@ -16,7 +16,7 @@ #define CM_MAX_TABLE_NUM 256 #define MAX_CONFIG_FN_LEN 256 -#define MAX_CONFIG_LINE 1024*4 +#define MAX_CONFIG_LINE (1024*16) #ifndef MAX #define MAX(a, b) (((a) > (b)) ? (a) : (b)) @@ -56,7 +56,7 @@ int decrypt_open(FILE* in,const unsigned char* key, const char* algorithm,unsign cipher=EVP_get_cipherbyname(algorithm); if(cipher==NULL) { - MESA_handle_runtime_log(logger,RLOG_LV_FATAL,module_config_monitor,"Not cipher:%s not supported.",algorithm); + MESA_handle_runtime_log(logger,RLOG_LV_FATAL,module_config_monitor,"Cipher %s is not supported.",algorithm); return 0; } dgst=EVP_get_digestbyname("md5");