diff --git a/compiler_service/src/aot_args_handler.cpp b/compiler_service/src/aot_args_handler.cpp index a586750a55840209d59a2885242bd3b9aade4320..f2fa9aa327d83122d25015680f01f68452426903 100644 --- a/compiler_service/src/aot_args_handler.cpp +++ b/compiler_service/src/aot_args_handler.cpp @@ -15,6 +15,7 @@ #include "aot_args_handler.h" +#include #include #include @@ -102,9 +103,10 @@ int32_t AOTArgsParserBase::FindArgsIdxToInteger(const std::unordered_map(std::stoi(argsMap.at(keyName), &sz)); - if (sz < static_cast(argsMap.at(keyName).size())) { + const char* beginPtr = argsMap.at(keyName).data(); + const char* endPtr = argsMap.at(keyName).data() + argsMap.at(keyName).size(); + auto res = std::from_chars(beginPtr, endPtr, bundleID); + if ((res.ec != std::errc()) || (res.ptr != endPtr)) { LOG_SA(ERROR) << "trigger exception as converting string to integer"; return ERR_AOT_COMPILER_PARAM_FAILED; } diff --git a/ecmascript/pgo_profiler/pgo_profiler_info.cpp b/ecmascript/pgo_profiler/pgo_profiler_info.cpp index 902abf1b7f700dd6cf70e3a136a67e5d84f3d7fa..bca2240159d61623f694ff06a35dcb39906b7a44 100644 --- a/ecmascript/pgo_profiler/pgo_profiler_info.cpp +++ b/ecmascript/pgo_profiler/pgo_profiler_info.cpp @@ -864,6 +864,7 @@ bool PGORecordDetailInfos::ParseRecordInfosFromBinary(void* buffer, PGOProfilerH SectionInfo* info = header->GetRecordInfoSection(); if (info == nullptr) { LOG_PGO(ERROR) << "[ParseRecordInfosFromBinary] section info is nullptr"; + return false; } void* addr = reinterpret_cast(reinterpret_cast(buffer) + info->offset_); for (uint32_t i = 0; i < info->number_; i++) {