解决asan下imageFUZZ编译失败问题

Signed-off-by: kangchongtao <kangchongtao@huawei.com>
This commit is contained in:
kangchongtao 2022-11-21 10:03:49 +08:00
parent 38dc002cfe
commit 39ae7db3d1
3 changed files with 5 additions and 5 deletions

View File

@ -20,6 +20,7 @@ group("fuzztest") {
"arkressched_fuzzer:ArkResschedFuzzTest",
#"imageApi_fuzzer:ImageApiFuzzTest",
"imageloader_fuzzer:ImageLoaderFuzzTest",
"manifest_fuzzer:ManifestFuzzTest",
"res2_fuzzer:Res2FuzzTest",
"res_fuzzer:ResFuzzTest",
@ -29,7 +30,4 @@ group("fuzztest") {
"utilengine_fuzzer:UtilEngineFuzzTest",
"utilmost_fuzzer:UtilMostFuzzTest",
]
if (!is_asan) {
deps += [ "imageloader_fuzzer:ImageLoaderFuzzTest" ]
}
}

View File

@ -100,7 +100,9 @@ ohos_fuzztest("ImageLoaderFuzzTest") {
#"$ace_root/frameworks/base/resource/internal_resource.cpp",
"$ace_root/frameworks/base/log/ace_tracker.cpp",
"$ace_root/frameworks/core/common/event_manager.cpp",
"$ace_root/frameworks/core/components/test/unittest/mock/event_report_mock.cpp",
"$ace_root/frameworks/core/components_ng/gestures/gesture_referee.cpp",
"$ace_root/frameworks/core/image/flutter_image_cache.cpp",
"$ace_root/frameworks/core/image/image_cache.cpp",
"$ace_root/frameworks/core/image/image_compressor.cpp",

View File

@ -15,8 +15,8 @@
#include "utilengine_fuzzer.h"
#include <securec.h>
#include "test/fuzztest/utilengine_fuzzer/utilengine_fuzzer.h"
#include "frameworks/bridge/common/utils/engine_helper.h"
#include "frameworks/bridge/js_frontend/engine/common/js_engine_loader.h"
@ -31,7 +31,7 @@ namespace OHOS {
if (size < sizeInt) {
return false;
}
memcpy(&id, data, sizeof(uint32_t));
memcpy_s(&id, sizeof(uint32_t), data, sizeof(uint32_t));
auto& loader = Framework::JsEngineLoader::GetDeclarative(DECLARATIVE_ENGINE_SHARED_LIB);
auto jsEngine = loader.CreateJsEngine(id);
EngineHelper::AddEngine(id, jsEngine);