summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluwenpeng <[email protected]>2020-09-25 17:46:41 +0800
committerluwenpeng <[email protected]>2020-09-25 17:46:41 +0800
commitea56ecd8fbc77986918c0139578afdabcb18b4d1 (patch)
tree4f1f4f5c56f59150dd3717d16ad019e10e929b89
parent736eaac1fbb46bf0c6abc057c56aa029df1c061d (diff)
TSG-3398 doh/pangu send log 时使用未初始化的内存
-rw-r--r--plugin/business/doh/src/logger.cpp2
-rw-r--r--plugin/business/pangu-http/src/pangu_logger.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/plugin/business/doh/src/logger.cpp b/plugin/business/doh/src/logger.cpp
index fc34a9d..6b626de 100644
--- a/plugin/business/doh/src/logger.cpp
+++ b/plugin/business/doh/src/logger.cpp
@@ -332,7 +332,7 @@ int doh_send_log(struct doh_conf *handle, const struct tfe_http_session *http, c
cJSON_AddStringToObject(common_obj, "doh_version", app_proto[http->major_version]);
cJSON_AddStringToObject(common_obj, "common_schema_type", "DOH");
- char opt_val[24];
+ char opt_val[24] = { 0 };
uint16_t opt_out_size;
struct tfe_cmsg *cmsg = tfe_stream_get0_cmsg(stream);
if (cmsg != NULL)
diff --git a/plugin/business/pangu-http/src/pangu_logger.cpp b/plugin/business/pangu-http/src/pangu_logger.cpp
index c7487b5..d48b4e2 100644
--- a/plugin/business/pangu-http/src/pangu_logger.cpp
+++ b/plugin/business/pangu-http/src/pangu_logger.cpp
@@ -118,7 +118,7 @@ int pangu_send_log(struct pangu_logger* handle, const struct pangu_log* log_msg)
cJSON_AddStringToObject(common_obj, "http_version", app_proto[http->major_version]);
cJSON_AddStringToObject(common_obj, "common_schema_type", "HTTP");
- char opt_val[24]; uint16_t opt_out_size;
+ char opt_val[24] = { 0 }; uint16_t opt_out_size;
struct tfe_cmsg * cmsg = tfe_stream_get0_cmsg(log_msg->stream);
if (cmsg!=NULL)
{