summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliuxueli <[email protected]>2022-01-04 17:07:02 +0300
committerliuxueli <[email protected]>2022-01-04 17:07:02 +0300
commit0b794950ee68a5a75ccdf59e2a99cd4ff46c58a1 (patch)
tree90a9d7e055f7aa668877f4c09125c4387be22b22
parent1e07351fa19c36166cfb1c17926918b8c807ee14 (diff)
TSG-9262: 命中拦截策略发日志时streamingo已销毁,使用streaminfo获取流标签时导致SAPP重启v5.4.25
-rw-r--r--src/tsg_send_log.cpp12
1 files changed, 12 insertions, 0 deletions
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;