diff --git a/src/tsg_rule.cpp b/src/tsg_rule.cpp index 2e380f7..80d4f15 100644 --- a/src/tsg_rule.cpp +++ b/src/tsg_rule.cpp @@ -3250,6 +3250,11 @@ int tsg_app_id2name(int app_id, char *app_name, int app_name_len, int is_joint_p dict=(struct app_id_dict *)Maat_plugin_get_EX_data(g_tsg_maat_feather, g_tsg_para.table_id[TABLE_APP_ID_DICT], (const char *)app_id_buff); if(dict!=NULL) { + if((int)strlen(dict->app_name) > app_name_len) + { + return offset; + } + if(dict->parent_app_id!=0 && is_joint_parent==1) { offset=snprintf(app_name, app_name_len, "%s.%s", dict->parent_app_name, dict->app_name); diff --git a/src/tsg_send_log.cpp b/src/tsg_send_log.cpp index 45c204a..4f1be74 100644 --- a/src/tsg_send_log.cpp +++ b/src/tsg_send_log.cpp @@ -832,11 +832,11 @@ int set_app_full_path(struct TLD_handle_t *_handle, char *field_name, struct gat if(result[ORIGIN_USER_DEFINE].app_num>0) { - combined_num+=copy_app_id(result[ORIGIN_USER_DEFINE].attributes, result[ORIGIN_USER_DEFINE].app_num, combined_array+combined_num, COMBINED_APP_ID_NUM-combined_num); + combined_num+=copy_app_id(result[ORIGIN_USER_DEFINE].attributes, 1, combined_array+combined_num, COMBINED_APP_ID_NUM-combined_num); } else if(result[ORIGIN_BUILT_IN].app_num>0) { - combined_num+=copy_app_id(result[ORIGIN_BUILT_IN].attributes, result[ORIGIN_BUILT_IN].app_num, combined_array+combined_num, COMBINED_APP_ID_NUM-combined_num); + combined_num+=copy_app_id(result[ORIGIN_BUILT_IN].attributes, 1, combined_array+combined_num, COMBINED_APP_ID_NUM-combined_num); } else if(result[ORIGIN_QM_ENGINE].app_num-result[ORIGIN_QM_ENGINE_L7].app_num > 0) {