From 29aae3c4b9eec1c4afde63285cb4d6f6611fd991 Mon Sep 17 00:00:00 2001 From: qianyong325 Date: Thu, 17 Apr 2025 14:48:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qianyong325 --- bundle.json | 3 +-- test/fuzztest/controlchannelstub_fuzzer/BUILD.gn | 2 ++ test/fuzztest/imeeventmonitormanager_fuzzer/BUILD.gn | 8 +++++++- .../inputmethodcontroller_fuzzer.cpp | 9 --------- .../systemcmdchannelstub_fuzzer.cpp | 1 - 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/bundle.json b/bundle.json index c4fe00354..f44e25f7a 100644 --- a/bundle.json +++ b/bundle.json @@ -58,8 +58,7 @@ "hicollie", "resource_management", "screenlock_mgr", - "cJSON", - "idl_tool" + "cJSON" ] }, "build": { diff --git a/test/fuzztest/controlchannelstub_fuzzer/BUILD.gn b/test/fuzztest/controlchannelstub_fuzzer/BUILD.gn index 0ee0423fd..d0c82f713 100644 --- a/test/fuzztest/controlchannelstub_fuzzer/BUILD.gn +++ b/test/fuzztest/controlchannelstub_fuzzer/BUILD.gn @@ -35,6 +35,8 @@ ohos_fuzztest("ControlChannelStubFuzzTest") { ] sources = [ + "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp", + "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_utils.cpp", "${inputmethod_path}/services/src/input_control_channel_service_impl.cpp", "controlchannelstub_fuzzer.cpp", ] diff --git a/test/fuzztest/imeeventmonitormanager_fuzzer/BUILD.gn b/test/fuzztest/imeeventmonitormanager_fuzzer/BUILD.gn index 2f304578d..b4a518ab3 100644 --- a/test/fuzztest/imeeventmonitormanager_fuzzer/BUILD.gn +++ b/test/fuzztest/imeeventmonitormanager_fuzzer/BUILD.gn @@ -34,12 +34,18 @@ ohos_fuzztest("ImeEventMonitorManagerFuzzTest") { "-fno-omit-frame-pointer", ] - sources = [ "imeeventmonitormanager_fuzzer.cpp" ] + sources = [ + "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp", + "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_utils.cpp", + "imeeventmonitormanager_fuzzer.cpp", + ] deps = [ "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client", "${inputmethod_path}/test/common:inputmethod_test_common", ] + + external_deps = [ "input:libmmi-client" ] } ############################################################################### diff --git a/test/fuzztest/inputmethodcontroller_fuzzer/inputmethodcontroller_fuzzer.cpp b/test/fuzztest/inputmethodcontroller_fuzzer/inputmethodcontroller_fuzzer.cpp index ec2916df9..bcd0b276b 100644 --- a/test/fuzztest/inputmethodcontroller_fuzzer/inputmethodcontroller_fuzzer.cpp +++ b/test/fuzztest/inputmethodcontroller_fuzzer/inputmethodcontroller_fuzzer.cpp @@ -190,14 +190,6 @@ void FUZZPrintLogIfAceTimeout(sptr imc, int64_t start) { imc->PrintLogIfAceTimeout(start); } - -void FUZZSendPrivateData(sptr imc, const std::string &fuzzedString) -{ - std::unordered_map fuzzedPrivateCommand; - PrivateDataValue privateDataValue = std::string(fuzzedString); - fuzzedPrivateCommand.emplace("value", privateDataValue); - imc->SendPrivateData(fuzzedPrivateCommand); -} } // namespace OHOS /* Fuzzer entry point */ @@ -231,6 +223,5 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) OHOS::FUZZIsPanelShown(imc, data); OHOS::FUZZPrintLogIfAceTimeout(imc, fuzzedint64); OHOS::TestUpdateListenEventFlag(imc, fuzzedUint32); - OHOS::FUZZSendPrivateData(imc, fuzzedString); return 0; } diff --git a/test/fuzztest/systemcmdchannelstub_fuzzer/systemcmdchannelstub_fuzzer.cpp b/test/fuzztest/systemcmdchannelstub_fuzzer/systemcmdchannelstub_fuzzer.cpp index c288c28e8..ee8356740 100644 --- a/test/fuzztest/systemcmdchannelstub_fuzzer/systemcmdchannelstub_fuzzer.cpp +++ b/test/fuzztest/systemcmdchannelstub_fuzzer/systemcmdchannelstub_fuzzer.cpp @@ -62,7 +62,6 @@ bool FuzzSystemCmdChannelStub(const uint8_t *rawData, size_t size) MessageOption option; sptr stub = new SystemCmdChannelServiceImpl(); - stub->SendPrivateCommand(privateCommand); stub->NotifyPanelStatus(sysPanelStatus); stub->OnRemoteRequest(code, data, reply, option); return true; -- Gitee