From ff7b0d321db35a32af055199837d554aa05a5ecf Mon Sep 17 00:00:00 2001 From: wgs13579 Date: Sat, 5 Jun 2021 17:52:02 +0800 Subject: [PATCH] fix coverity bug --- src/lib/oblog/ob_log.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/oblog/ob_log.cpp b/src/lib/oblog/ob_log.cpp index e69093e..0dd49e9 100644 --- a/src/lib/oblog/ob_log.cpp +++ b/src/lib/oblog/ob_log.cpp @@ -1528,12 +1528,15 @@ void ObLogger::do_async_flush_to_file(ObLogItem **log_item, const int64_t count) } } - struct iovec vec[MAX_FD_FILE][GROUP_COMMIT_MAX_ITEM_COUNT] = {0}; + struct iovec vec[MAX_FD_FILE][GROUP_COMMIT_MAX_ITEM_COUNT]; int iovcnt[MAX_FD_FILE] = {0}; int large_iovcnt[MAX_FD_FILE] = {0}; - struct iovec wf_vec[MAX_FD_FILE][GROUP_COMMIT_MAX_ITEM_COUNT] = {0}; + struct iovec wf_vec[MAX_FD_FILE][GROUP_COMMIT_MAX_ITEM_COUNT]; int wf_iovcnt[MAX_FD_FILE] = {0}; + memset(vec, 0, sizeof(vec)); + memset(wf_vec, 0, sizeof(wf_vec)); + ObLogFDType fd_type = MAX_FD_FILE; for (int64_t i = 0; i < count; ++i) { if (OB_ISNULL(log_item[i])) { -- GitLab