From 0b794950ee68a5a75ccdf59e2a99cd4ff46c58a1 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Tue, 4 Jan 2022 17:07:02 +0300 Subject: TSG-9262: 命中拦截策略发日志时streamingo已销毁,使用streaminfo获取流标签时导致SAPP重启 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tsg_send_log.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/tsg_send_log.cpp b/src/tsg_send_log.cpp index 4f19132..be22c9e 100644 --- a/src/tsg_send_log.cpp +++ b/src/tsg_send_log.cpp @@ -1242,6 +1242,11 @@ static int set_common_sub_action(struct TLD_handle_t *handle, char *field_name, int set_application_behavior(struct tsg_log_instance_t *_instance, struct TLD_handle_t *_handle, struct streaminfo *a_stream) { + if(a_stream==NULL) + { + return 0; + } + struct application_behavior *behavior_result=NULL; behavior_result=(struct application_behavior *)stream_bridge_async_data_get(a_stream, g_tsg_para.bridge_id[BRIDGE_TYPE_APP_BEHAVIOR_RESULT]); if(behavior_result==NULL) @@ -1256,6 +1261,11 @@ int set_application_behavior(struct tsg_log_instance_t *_instance, struct TLD_ha int set_notify_execution_result(struct tsg_log_instance_t *_instance, struct TLD_handle_t *_handle, struct streaminfo *a_stream, struct Maat_rule_t *p_result) { + if(a_stream==NULL) + { + return 0; + } + int i=0; struct tsg_notify_execution_result *execution_result=NULL; execution_result=(struct tsg_notify_execution_result *)stream_bridge_async_data_get(a_stream, g_tsg_para.bridge_id[BRIDGE_TYPE_CONN_SKETCH_EXEC_RESULT]); @@ -1268,6 +1278,8 @@ int set_notify_execution_result(struct tsg_log_instance_t *_instance, struct TLD { if(execution_result->stat_mirrored[i].compile_id==p_result->config_id) { + TLD_delete(_handle, _instance->id2field[LOG_COMMON_MIRRORED_PKTS].name); + TLD_delete(_handle, _instance->id2field[LOG_COMMON_MIRRORED_BYTES].name); TLD_append(_handle, _instance->id2field[LOG_COMMON_MIRRORED_PKTS].name, (void *)(execution_result->stat_mirrored[i].packets), TLD_TYPE_LONG); TLD_append(_handle, _instance->id2field[LOG_COMMON_MIRRORED_BYTES].name, (void *)(execution_result->stat_mirrored[i].bytes), TLD_TYPE_LONG); break; -- cgit v1.2.3