From 0b5d877dbca20c3f3a9793a0c17cf0503888fa85 Mon Sep 17 00:00:00 2001 From: Ahmad Tarraf Date: Tue, 7 Oct 2025 10:50:24 +0200 Subject: [PATCH] fixed buffer overflow during large files writes --- include/common/msgpack_util.hpp | 10 +++++----- src/common/msgpack_util.cpp | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/common/msgpack_util.hpp b/include/common/msgpack_util.hpp index ae9eaab18..a1c280d38 100644 --- a/include/common/msgpack_util.hpp +++ b/include/common/msgpack_util.hpp @@ -65,14 +65,14 @@ public: * actually sent */ struct msgpack_data { - uint32_t flush_t_; + uint64_t flush_t_; std::string hostname_; int pid_; std::string io_type_; - std::vector start_t_{}; - std::vector end_t_{}; - std::vector req_size_{}; - uint32_t total_bytes_{}; + std::vector start_t_{}; + std::vector end_t_{}; + std::vector req_size_{}; + uint64_t total_bytes_{}; int total_iops_{0}; template diff --git a/src/common/msgpack_util.cpp b/src/common/msgpack_util.cpp index 1f18e1d9d..687bacf50 100644 --- a/src/common/msgpack_util.cpp +++ b/src/common/msgpack_util.cpp @@ -94,6 +94,8 @@ ClientMetrics::~ClientMetrics() { if(flush_thread_.joinable()) flush_thread_.join(); if(flush_type_ == client_metric_flush_type::socket) { + // flush before closing + flush_msgpack(); zmq_flush_socket_->close(); zmq_flush_context_->close(); } -- GitLab