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/Servo/Model.cpp |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index 6882783..ed29052 100644
--- a/SourceCode/Bond/Servo/Model.cpp
+++ b/SourceCode/Bond/Servo/Model.cpp
@@ -184,6 +184,7 @@
 
 int CModel::init()
 {
+	const ULONGLONG boot_model_begin = GetTickCount64();
 	CString strIniFile;
 	CString strUnitId;
 	strIniFile.Format(_T("%s\\ServoConfiguration.ini"), (LPTSTR)(LPCTSTR)m_strWorkDir);
@@ -214,6 +215,7 @@
 	CLog::GetLog()->SetLogsDir(strLogDir);
 	CLog::GetLog()->SetEquipmentId((LPTSTR)(LPCTSTR)strUnitId);
 	LOGI("\r\n\r\n~~~ Prog Start! ~~~");
+	LOGI("[BOOT][MODEL] init begin");
 
 
 	SECSListener listener;
@@ -419,6 +421,8 @@
 	}
 	strVarialbleFile.Format(_T("%s\\HsmsPassive.cache"), (LPTSTR)(LPCTSTR)m_strWorkDir);
 	m_hsmsPassive.loadCacheFromFile(strVarialbleFile);
+	LOGI("[BOOT][MODEL] HSMS config loaded, cost=%llu ms",
+		(unsigned long long)(GetTickCount64() - boot_model_begin));
 
 
 	SERVO::MasterListener masterListener;
@@ -922,6 +926,8 @@
 	char szBuffer[MAX_PATH];
 	sprintf_s(szBuffer, MAX_PATH, "%s\\AlarmList.csv", (LPTSTR)(LPCTSTR)m_strWorkDir);
 	alarmManager.readAlarmFile(szBuffer);
+	LOGI("[BOOT][MODEL] Alarm list loaded, cost=%llu ms",
+		(unsigned long long)(GetTickCount64() - boot_model_begin));
 
 
 	// Glass鏁版嵁搴�
@@ -930,6 +936,8 @@
 	GlassLogDb::Init(path);
 
 
+	LOGI("[BOOT][MODEL] init finished, total cost=%llu ms",
+		(unsigned long long)(GetTickCount64() - boot_model_begin));
 	return 0;
 }
 

--
Gitblit v1.9.3