From ab05e1fd09b8857f3a3ec2aae644025135c31eb2 Mon Sep 17 00:00:00 2001 From: herongpeng Date: Tue, 26 Aug 2025 10:45:42 +0800 Subject: [PATCH] fix stack overflow fix stack overflow Issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/ICUP24 Signed-off-by: herongpeng Change-Id: Id740e363a06bd2a1f3fbe905a0de92b8981bfab7 --- .../aotcompilerargsprepare_fuzzer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler_service/test/fuzztest/aotcompilerargsprepare_fuzzer/aotcompilerargsprepare_fuzzer.cpp b/compiler_service/test/fuzztest/aotcompilerargsprepare_fuzzer/aotcompilerargsprepare_fuzzer.cpp index 98bb8fc8b1..695e008885 100644 --- a/compiler_service/test/fuzztest/aotcompilerargsprepare_fuzzer/aotcompilerargsprepare_fuzzer.cpp +++ b/compiler_service/test/fuzztest/aotcompilerargsprepare_fuzzer/aotcompilerargsprepare_fuzzer.cpp @@ -68,7 +68,9 @@ bool DoSomethingInterestingWithMyAPI(const char* data, size_t size) // parse sigData while (offset + sizeof(int16_t) < size) { int16_t signalValue; - std::copy_n(&data[offset], sizeof(int16_t), &signalValue); + if (memcpy_s(&signalValue, sizeof(int16_t), &data[offset], sizeof(int16_t)) != 0) { + break; + } sigData.push_back(signalValue); offset += sizeof(int16_t); } -- Gitee