From d7c88780e1df54f34563d60bd7fa01011d2eef03 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期一, 26 一月 2026 23:17:17 +0800
Subject: [PATCH] 1.CSVData.cpp 里 unserialize 用了 8*2、125*2,但 serialize 只写 8 + 125 字节。 m_svRawData.insert 的 end 指针是 pszBuffer + 125*2,没有用 index 计算,可能把无效区域一起拷进去。 一旦 size 实际是 133(不是 266),就会直接越界,堆会被破坏,m_svDatas.clear() 在销毁元素时崩。
---
SourceCode/Bond/SGMeasurement/Logger.h | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/SourceCode/Bond/SGMeasurement/Logger.h b/SourceCode/Bond/SGMeasurement/Logger.h
index aec95af..2b9f84d 100644
--- a/SourceCode/Bond/SGMeasurement/Logger.h
+++ b/SourceCode/Bond/SGMeasurement/Logger.h
@@ -1,28 +1,28 @@
-#pragma once
+锘�#pragma once
#include <afx.h>
class CLogger
{
public:
- static CLogger& Instance(); // 获取单例
- void WriteLine(CString str); // 写一行日志
- void CloseLogFile(); // 关闭日志文件
+ static CLogger& Instance(); // 鑾峰彇鍗曚緥
+ void WriteLine(CString str); // 鍐欎竴琛屾棩蹇�
+ void CloseLogFile(); // 鍏抽棴鏃ュ織鏂囦欢
private:
- CLogger();
- ~CLogger();
- void OpenLogFile(); // 内部打开文件
+ CLogger();
+ ~CLogger();
+ void OpenLogFile(); // 鍐呴儴鎵撳紑鏂囦欢
- CCriticalSection m_csLogLock;
- CString m_strCurrentLogPath;
- CStdioFile m_logFile;
+ CCriticalSection m_csLogLock;
+ CString m_strCurrentLogPath;
+ CStdioFile m_logFile;
};
#define LOG_LINE(x) CLogger::Instance().WriteLine(x)
#define LOG_LINEF(fmt, ...) \
- do { \
- CString __log__; \
- __log__.Format(fmt, __VA_ARGS__); \
- CLogger::Instance().WriteLine(__log__); \
- } while (0)
\ No newline at end of file
+ do { \
+ CString __log__; \
+ __log__.Format(fmt, __VA_ARGS__); \
+ CLogger::Instance().WriteLine(__log__); \
+ } while (0)
\ No newline at end of file
--
Gitblit v1.9.3