From 1a893210e88e8a152211485d99f0753181a92aa2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Apr 2025 15:51:49 +0800 Subject: [PATCH] fix codex Signed-off-by: unknown --- services/updater_binary/update_image_patch.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/updater_binary/update_image_patch.cpp b/services/updater_binary/update_image_patch.cpp index 5ce712dd..ec3b3c58 100644 --- a/services/updater_binary/update_image_patch.cpp +++ b/services/updater_binary/update_image_patch.cpp @@ -290,7 +290,11 @@ int32_t USInstrImageShaCheck::CheckHash(const CheckPara ¶) LOG(ERROR) << "para size error " << para.srcSize; return USCRIPT_ERROR_EXECUTE; } - size_t length = std::stoul(para.srcSize); + uint32_t length = 0; + if (!Utils::ConvertToUnsignedLong(para.srcSize, length)) { + LOG(ERROR) << "ConvertToUnsignedLong error"; + return USCRIPT_ERROR_EXECUTE; + } UpdatePatch::BlockBuffer data = { mapBuffer.memory, length }; std::string resultSha = UpdatePatch::GeneraterBufferHash(data); std::transform(resultSha.begin(), resultSha.end(), resultSha.begin(), ::toupper); -- Gitee