Просмотр исходного кода

#IQRV #comment 准入 delete[] 处理

80374374 5 месяцев назад
Родитель
Сommit
b895c1da60

+ 3 - 9
Module/mod_accessauth/AccessAuthFSM.h

@@ -9,11 +9,7 @@
 #include "json/json.h"
 #include "CommEntityRestful.hpp"
 
-#ifdef RVC_OS_WIN
-///*TODO:  (80374374@11/27/2023)*/
-typedef CAutoArray<CSimpleStringA>  NetworkAddressesList;
-#define MACSESION 6
-#else
+#ifdef RVC_OS_LINUX
 #include <mutex>
 #include "publicFunExport.h"
 #include <winpr/sysinfo.h>
@@ -21,7 +17,7 @@ static void GetLocalTimeRVC(SYSTEMTIME& stTime)
 {
 	GetLocalTime(&stTime);
 }
-#endif // RVC_OS_WIN
+#endif // RVC_OS_LINUX
 
 #define ACS_SUCCESS "0"
 #define REFLECTION(var) #var
@@ -214,7 +210,5 @@ private:
 	CSimpleStringA m_accessAuthHost, m_initDeviceHost;
 	int m_torelateDiffSyncTimeSecs;
 	int m_finishAccess;
-#ifdef RVC_OS_LINUX
-	int m_nCheckMD5;
-#endif // RVC_OS_LINUX
+	int m_nCheckMD5; //just for uos
 };

+ 3 - 2
Module/mod_accessauth/comm.cpp

@@ -48,6 +48,7 @@ string GetOutPutStr(const char* form, ...) {
 	}
 	va_list vaList;
 	va_start(vaList, form);
+	//TODO: CrossPlaform  [Gifur@2025630]
 #ifdef RVC_OS_WIN
 	int acount = _vscprintf(newForm, vaList);
 #else
@@ -62,8 +63,8 @@ string GetOutPutStr(const char* form, ...) {
 
 	string ret;
 	ret.assign(buf);
-	delete buf;
-	delete newForm;
+	delete [] buf;
+	delete [] newForm;
 	return ret;
 }
 

+ 4 - 5
Module/mod_accessauth/mod_AccessAuth.cpp

@@ -18,11 +18,9 @@ using namespace PinPad;
 #include "WMIDeviceQuery.h"
 #include <WinCrypt.h>
 #include <Strsafe.h>
-#include "DeviceBaseClass.h"
 #include "MyBase64.h"
-#else
-#include "DeviceBaseClass.h"
 #endif
+#include "DeviceBaseClass.h"
 
 extern int HexBuf2StrBuf(PBYTE hexBuf, char** strBuf, DWORD len);
 extern int StrBuf2HexBuf(LPCTSTR strBuf, PBYTE* hexBuf);
@@ -620,6 +618,8 @@ bool CAccessAuthEntity::GetTerminalPublicKey(BYTE* pBuf, int& nBufLen, string& p
 		return false;
 	}
 	runInfoPath += SPLIT_SLASH_STR "runcfg" SPLIT_SLASH_STR;
+
+	//TODO: CrossPlaform  [Gifur@2025630]
 #ifdef RVC_OS_WIN
 	DWORD dwAttr = GetFileAttributes(runInfoPath.GetData());
 	if (dwAttr == 0xFFFFFFFF)  //目录不存在则创建   
@@ -1184,7 +1184,7 @@ void CAccessAuthEntity::GetNetMsg(SpReqAnsContext<AccessAuthService_GetNetMsg_Re
 	m_FSM.GetNetMsg(ctx);
 	return;
 }
-
+//TODO: CrossPlaform  抽离到公共工具类中?  [Gifur@2025630]
 bool CAccessAuthEntity::GenerateRandomNum()
 {
 	LOG_FUNCTION();
@@ -1221,7 +1221,6 @@ bool CAccessAuthEntity::GenerateRandomNum()
 }
 pair<string, string> CAccessAuthEntity::GenerateTmkToKMC()
 {
-	LOG_FUNCTION();
 	if (!GenerateRandomNum())
 		return make_pair("", "");
 #ifdef DEVOPS_ON_ST /*DevOps流水线编译,ST环境*/

+ 0 - 3
Module/mod_accessauth/mod_AccessAuth.h

@@ -1,8 +1,5 @@
 #pragma once
 #include "SpBase.h"
-#ifdef RVC_OS_WIN
-//#include "RVCCrypt.h"
-#endif // RVC_OS_WIN
 #include "AccessAuthorization_server_g.h"
 using namespace AccessAuthorization;
 

+ 0 - 4
Module/mod_healthmanager/mod_healthmanager.h

@@ -51,16 +51,12 @@ struct RestartModeInfo
 	DWORD dwInternal;
 };
 
-#define MACSESION 6
-
-
 #include <winpr/sysinfo.h>
 static void GetLocalTimeRVC(SYSTEMTIME& stTime)
 {
 	GetLocalTime(&stTime);
 }
 
-
 class HealthManagerSession : public HealthManagerService_ServerSessionBase
 {
 public: