diff --git a/deps/oblib/src/lib/restore/cos/ob_cos_wrapper.cpp b/deps/oblib/src/lib/restore/cos/ob_cos_wrapper.cpp index c795040f9..666ef5d97 100644 --- a/deps/oblib/src/lib/restore/cos/ob_cos_wrapper.cpp +++ b/deps/oblib/src/lib/restore/cos/ob_cos_wrapper.cpp @@ -55,6 +55,7 @@ static int64_t strtotime(const char *date_time) { int64_t time = 0; struct tm tm_time; + memset(&tm_time, 0, sizeof(struct tm)); if (NULL == strptime(date_time, "%a, %d %b %Y %H:%M:%S %Z", &tm_time)) { //skip set ret, for compat data formate cos_warn_log("[COS]failed to transform time, time=%s\n", date_time); diff --git a/deps/oblib/src/lib/restore/ob_storage_oss_base.cpp b/deps/oblib/src/lib/restore/ob_storage_oss_base.cpp index 17b6668aa..556e3f692 100644 --- a/deps/oblib/src/lib/restore/ob_storage_oss_base.cpp +++ b/deps/oblib/src/lib/restore/ob_storage_oss_base.cpp @@ -1627,6 +1627,7 @@ int ObStorageOssUtil::strtotime(const char *date_time, int64_t &time) int ret = OB_SUCCESS; time = 0; struct tm tm_time; + memset(&tm_time, 0, sizeof(struct tm)); if (OB_ISNULL(date_time)) { ret = OB_INVALID_ARGUMENT; OB_LOG(WARN, "strtotime get invalid argument", K(ret), KP(date_time)); diff --git a/src/share/config/ob_config.cpp b/src/share/config/ob_config.cpp index 7e05382ab..41a85dc56 100644 --- a/src/share/config/ob_config.cpp +++ b/src/share/config/ob_config.cpp @@ -714,6 +714,7 @@ bool ObConfigMomentItem::set(const char *str) { int ret = true; struct tm tm_value; + memset(&tm_value, 0, sizeof(struct tm)); if (0 == STRCASECMP(str, "disable")) { value_.disable_ = true; } else if (OB_ISNULL(strptime(str, "%H:%M", &tm_value))) {