From 6075892145bf1750ccc08c81a4c19261c20e6d6d Mon Sep 17 00:00:00 2001 From: qyt <486179@qq.com> Date: Fri, 8 May 2026 10:02:20 +0000 Subject: [PATCH] Potential fix for code scanning alert no. 13 Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- XEngine_Source/XEngine_StorageApp/StorageApp_Download.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/XEngine_Source/XEngine_StorageApp/StorageApp_Download.cpp b/XEngine_Source/XEngine_StorageApp/StorageApp_Download.cpp index 1d49f9f..20cafd4 100644 --- a/XEngine_Source/XEngine_StorageApp/StorageApp_Download.cpp +++ b/XEngine_Source/XEngine_StorageApp/StorageApp_Download.cpp @@ -263,12 +263,14 @@ bool XEngine_Task_HttpDownload(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, in Cryption_Api_Digest(tszFileDir, tszHashKey, &nHashLen, true, st_ServiceCfg.st_XStorage.nHashMode); BaseLib_String_StrToHex((char*)tszHashKey, nHashLen, tszHashStr); BaseLib_String_GetFileAndPath(tszFileDir, NULL, NULL, NULL, st_HDRParam.tszMimeType); - if (nLimit > 0) + int nEffectiveLimit = nLimit > 0 ? nLimit : 0; + xhLimit = NULL; + if (nEffectiveLimit > 0) { xhLimit = Algorithm_Calculation_Create(); } //插入数据 - if (!Session_DLStroage_Insert(lpszClientAddr, st_StorageBucket.tszBuckKey, tszFileDir, &ullCount, &ullSize, nPosStart, nPosEnd, tszHashStr, nLimit, xhLimit)) + if (!Session_DLStroage_Insert(lpszClientAddr, st_StorageBucket.tszBuckKey, tszFileDir, &ullCount, &ullSize, nPosStart, nPosEnd, tszHashStr, nEffectiveLimit, xhLimit)) { st_HDRParam.bIsClose = true; st_HDRParam.nHttpCode = 404;