From 3d68725e58470515aec672a8c058380b2b8da6f1 Mon Sep 17 00:00:00 2001 From: qianyong325 Date: Wed, 30 Apr 2025 14:06:05 +0800 Subject: [PATCH] add fuzz Signed-off-by: qianyong325 --- .../agentstub_fuzzer/agentstub_fuzzer.cpp | 5 +- .../corestub_fuzzer/corestub_fuzzer.cpp | 5 +- .../datachannelstub_fuzzer.cpp | 5 +- .../inputmethodsystemability_fuzzer.cpp | 26 +++ .../systemabilitystubfuzztest/BUILD.gn | 198 ++++++++++++++++++ .../commandenableime_fuzzer.cpp | 30 +++ .../commandenableime_fuzzer.h | 21 ++ .../commandenableime_fuzzer/corpus/init | 14 ++ .../commandenableime_fuzzer/project.xml | 25 +++ .../commandgetinputmethodstate_fuzzer.cpp | 30 +++ .../commandgetinputmethodstate_fuzzer.h | 21 ++ .../corpus/init | 14 ++ .../project.xml | 25 +++ .../commandgetinputstartinfo_fuzzer.cpp | 30 +++ .../commandgetinputstartinfo_fuzzer.h | 21 ++ .../corpus/init | 14 ++ .../project.xml | 25 +++ ...mmandhidecurrentinputdeprecated_fuzzer.cpp | 30 +++ ...commandhidecurrentinputdeprecated_fuzzer.h | 21 ++ .../corpus/init | 14 ++ .../project.xml | 25 +++ .../commandinitconnect_fuzzer.cpp | 30 +++ .../commandinitconnect_fuzzer.h | 21 ++ .../commandinitconnect_fuzzer/corpus/init | 14 ++ .../commandinitconnect_fuzzer/project.xml | 25 +++ .../commandiscurrentimebypid_fuzzer.cpp | 30 +++ .../commandiscurrentimebypid_fuzzer.h | 21 ++ .../corpus/init | 14 ++ .../project.xml | 25 +++ .../commandisdefaultimeset_fuzzer.cpp | 30 +++ .../commandisdefaultimeset_fuzzer.h | 21 ++ .../commandisdefaultimeset_fuzzer/corpus/init | 14 ++ .../commandisdefaultimeset_fuzzer/project.xml | 25 +++ .../commandissystemappset_fuzzer.cpp | 30 +++ .../commandissystemappset_fuzzer.h | 21 ++ .../commandissystemappset_fuzzer/corpus/init | 14 ++ .../commandissystemappset_fuzzer/project.xml | 25 +++ .../commandregisterproxyime_fuzzer.cpp | 30 +++ .../commandregisterproxyime_fuzzer.h | 21 ++ .../corpus/init | 14 ++ .../project.xml | 25 +++ .../commandsetcallingwindow_fuzzer.cpp | 30 +++ .../commandsetcallingwindow_fuzzer.h | 21 ++ .../corpus/init | 14 ++ .../project.xml | 25 +++ .../commandunregisterproxyime_fuzzer.cpp | 30 +++ .../commandunregisterproxyime_fuzzer.h | 21 ++ .../corpus/init | 14 ++ .../project.xml | 25 +++ .../common/imf_sa_stub_fuzz_util.cpp | 5 +- 50 files changed, 1224 insertions(+), 10 deletions(-) create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandenableime_fuzzer/commandenableime_fuzzer.cpp create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandenableime_fuzzer/commandenableime_fuzzer.h create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandenableime_fuzzer/corpus/init create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandenableime_fuzzer/project.xml create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandgetinputmethodstate_fuzzer/commandgetinputmethodstate_fuzzer.cpp create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandgetinputmethodstate_fuzzer/commandgetinputmethodstate_fuzzer.h create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandgetinputmethodstate_fuzzer/corpus/init create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandgetinputmethodstate_fuzzer/project.xml create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandgetinputstartinfo_fuzzer/commandgetinputstartinfo_fuzzer.cpp create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandgetinputstartinfo_fuzzer/commandgetinputstartinfo_fuzzer.h create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandgetinputstartinfo_fuzzer/corpus/init create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandgetinputstartinfo_fuzzer/project.xml create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandhidecurrentinputdeprecated_fuzzer/commandhidecurrentinputdeprecated_fuzzer.cpp create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandhidecurrentinputdeprecated_fuzzer/commandhidecurrentinputdeprecated_fuzzer.h create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandhidecurrentinputdeprecated_fuzzer/corpus/init create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandhidecurrentinputdeprecated_fuzzer/project.xml create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandinitconnect_fuzzer/commandinitconnect_fuzzer.cpp create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandinitconnect_fuzzer/commandinitconnect_fuzzer.h create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandinitconnect_fuzzer/corpus/init create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandinitconnect_fuzzer/project.xml create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandiscurrentimebypid_fuzzer/commandiscurrentimebypid_fuzzer.cpp create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandiscurrentimebypid_fuzzer/commandiscurrentimebypid_fuzzer.h create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandiscurrentimebypid_fuzzer/corpus/init create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandiscurrentimebypid_fuzzer/project.xml create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandisdefaultimeset_fuzzer/commandisdefaultimeset_fuzzer.cpp create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandisdefaultimeset_fuzzer/commandisdefaultimeset_fuzzer.h create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandisdefaultimeset_fuzzer/corpus/init create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandisdefaultimeset_fuzzer/project.xml create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandissystemappset_fuzzer/commandissystemappset_fuzzer.cpp create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandissystemappset_fuzzer/commandissystemappset_fuzzer.h create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandissystemappset_fuzzer/corpus/init create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandissystemappset_fuzzer/project.xml create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandregisterproxyime_fuzzer/commandregisterproxyime_fuzzer.cpp create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandregisterproxyime_fuzzer/commandregisterproxyime_fuzzer.h create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandregisterproxyime_fuzzer/corpus/init create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandregisterproxyime_fuzzer/project.xml create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandsetcallingwindow_fuzzer/commandsetcallingwindow_fuzzer.cpp create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandsetcallingwindow_fuzzer/commandsetcallingwindow_fuzzer.h create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandsetcallingwindow_fuzzer/corpus/init create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandsetcallingwindow_fuzzer/project.xml create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandunregisterproxyime_fuzzer/commandunregisterproxyime_fuzzer.cpp create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandunregisterproxyime_fuzzer/commandunregisterproxyime_fuzzer.h create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandunregisterproxyime_fuzzer/corpus/init create mode 100644 test/fuzztest/systemabilitystubfuzztest/commandunregisterproxyime_fuzzer/project.xml diff --git a/test/fuzztest/agentstub_fuzzer/agentstub_fuzzer.cpp b/test/fuzztest/agentstub_fuzzer/agentstub_fuzzer.cpp index 01c4af521..de352d053 100644 --- a/test/fuzztest/agentstub_fuzzer/agentstub_fuzzer.cpp +++ b/test/fuzztest/agentstub_fuzzer/agentstub_fuzzer.cpp @@ -26,7 +26,8 @@ namespace OHOS { constexpr size_t THRESHOLD = 10; constexpr int32_t OFFSET = 4; const std::u16string AGENTSTUB_INTERFACE_TOKEN = u"OHOS.MiscServices.IInputMethodAgent"; - +constexpr uint32_t CODE_MIN = 0; +constexpr uint32_t CODE_MAX = static_cast(IInputMethodAgentIpcCode::COMMAND_SEND_MESSAGE) + 1; uint32_t ConvertToUint32(const uint8_t *ptr) { if (ptr == nullptr) { @@ -38,7 +39,7 @@ uint32_t ConvertToUint32(const uint8_t *ptr) bool FuzzAgentStub(const uint8_t *rawData, size_t size) { - uint32_t code = ConvertToUint32(rawData); + uint32_t code = static_cast(*rawData) % (CODE_MAX - CODE_MIN + 1) + CODE_MIN; rawData = rawData + OFFSET; size = size - OFFSET; diff --git a/test/fuzztest/corestub_fuzzer/corestub_fuzzer.cpp b/test/fuzztest/corestub_fuzzer/corestub_fuzzer.cpp index 7d5d7c6bb..e1613a142 100644 --- a/test/fuzztest/corestub_fuzzer/corestub_fuzzer.cpp +++ b/test/fuzztest/corestub_fuzzer/corestub_fuzzer.cpp @@ -26,7 +26,8 @@ namespace OHOS { constexpr size_t THRESHOLD = 10; constexpr int32_t OFFSET = 4; const std::u16string CORESTUB_INTERFACE_TOKEN = u"OHOS.MiscServices.IInputMethodCore"; - +constexpr uint32_t CODE_MIN = 0; +constexpr uint32_t CODE_MAX = static_cast(IInputMethodCoreIpcCode::COMMAND_ON_SEND_PRIVATE_DATA) + 1; uint32_t ConvertToUint32(const uint8_t *ptr) { if (ptr == nullptr) { @@ -38,7 +39,7 @@ uint32_t ConvertToUint32(const uint8_t *ptr) bool FuzzCoreStub(const uint8_t *rawData, size_t size) { - uint32_t code = ConvertToUint32(rawData); + uint32_t code = static_cast(*rawData) % (CODE_MAX - CODE_MIN + 1) + CODE_MIN; rawData = rawData + OFFSET; size = size - OFFSET; diff --git a/test/fuzztest/datachannelstub_fuzzer/datachannelstub_fuzzer.cpp b/test/fuzztest/datachannelstub_fuzzer/datachannelstub_fuzzer.cpp index 8f47ee5ae..27aa44c76 100644 --- a/test/fuzztest/datachannelstub_fuzzer/datachannelstub_fuzzer.cpp +++ b/test/fuzztest/datachannelstub_fuzzer/datachannelstub_fuzzer.cpp @@ -27,7 +27,8 @@ namespace OHOS { constexpr size_t THRESHOLD = 10; constexpr int32_t OFFSET = 4; const std::u16string DATACHANNEL_INTERFACE_TOKEN = u"OHOS.MiscServices.IInputDataChannel"; - +constexpr uint32_t CODE_MIN = 0; +constexpr uint32_t CODE_MAX = static_cast(IInputDataChannelIpcCode::COMMAND_SEND_MESSAGE) + 1; uint32_t ConvertToUint32(const uint8_t *ptr) { if (ptr == nullptr) { @@ -39,7 +40,7 @@ uint32_t ConvertToUint32(const uint8_t *ptr) bool FuzzDataChannelStub(const uint8_t *rawData, size_t size) { - uint32_t code = ConvertToUint32(rawData); + uint32_t code = static_cast(*rawData) % (CODE_MAX - CODE_MIN + 1) + CODE_MIN; rawData = rawData + OFFSET; size = size - OFFSET; diff --git a/test/fuzztest/inputmethodsystemability_fuzzer/inputmethodsystemability_fuzzer.cpp b/test/fuzztest/inputmethodsystemability_fuzzer/inputmethodsystemability_fuzzer.cpp index c5c1b859a..aa5e524f5 100644 --- a/test/fuzztest/inputmethodsystemability_fuzzer/inputmethodsystemability_fuzzer.cpp +++ b/test/fuzztest/inputmethodsystemability_fuzzer/inputmethodsystemability_fuzzer.cpp @@ -69,6 +69,30 @@ void FuzzOnUser(int32_t userId, const std::string &packageName) DelayedSingleton::GetInstance()->OnPackageRemoved(userId, bundleName); } +void FuzzOnScreenUnlock() +{ + DelayedSingleton::GetInstance()->OnScreenUnlock(nullptr); + + MessageParcel *parcel = nullptr; + auto msg = std::make_shared(MessageID::MSG_ID_SCREEN_UNLOCK, parcel); + DelayedSingleton::GetInstance()->OnScreenUnlock(msg.get()); + + MessageParcel *parcel1 = new (std::nothrow) MessageParcel(); + msg = std::make_shared(MessageID::MSG_ID_SCREEN_UNLOCK, parcel1); + DelayedSingleton::GetInstance()->OnScreenUnlock(msg.get()); + + MessageParcel *parcel2 = new (std::nothrow) MessageParcel(); + msg = std::make_shared(MessageID::MSG_ID_SCREEN_UNLOCK, parcel2); + DelayedSingleton::GetInstance()->OnScreenUnlock(msg.get()); +} + +void SystemAbility(const uint8_t *data, size_t size) +{ + auto fuzzedUint32 = static_cast(size); + DelayedSingleton::GetInstance()->HideInput(nullptr); + DelayedSingleton::GetInstance()->ReleaseInput(nullptr, fuzzedUint32); + DelayedSingleton::GetInstance()->SetCoreAndAgent(nullptr, nullptr); +} } // namespace OHOS /* Fuzzer entry point */ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) @@ -78,5 +102,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) std::string fuzzedString(reinterpret_cast(data), size); OHOS::FuzzOnUser(userId, fuzzedString); + OHOS::FuzzOnScreenUnlock(); + OHOS::SystemAbility(data, size); return 0; } diff --git a/test/fuzztest/systemabilitystubfuzztest/BUILD.gn b/test/fuzztest/systemabilitystubfuzztest/BUILD.gn index 2808cf338..41fc22677 100644 --- a/test/fuzztest/systemabilitystubfuzztest/BUILD.gn +++ b/test/fuzztest/systemabilitystubfuzztest/BUILD.gn @@ -52,6 +52,17 @@ group("system_ability_stub_fuzztest") { ":SwitchInputMethodFuzzTest", ":UnRegisteredProxyImeFuzzTest", ":UpdateListenEventFlagFuzzTest", + ":CommandIsCurrentImeByPidFuzzTest", + ":CommandIsDefaultImeSetFuzzTest", + ":CommandIsSystemAppSetFuzzTest", + ":CommandGetInputMethodStateFuzzTest", + ":CommandHideCurrentInputDeprecatedFuzzTest", + ":CommandInitConnectFuzzTest", + ":CommandSetCallingWindowFuzzTest", + ":CommandGetInputStartInfoFuzzTest", + ":CommandRegisterProxyImeFuzzTest", + ":CommandUnregisterProxyImeFuzzTest", + ":CommandEnableImeFuzzTest", ] } @@ -642,3 +653,190 @@ ohos_fuzztest("ConnectSystemCmdFuzzTest") { external_deps = common_external_deps } + +ohos_fuzztest("CommandIsCurrentImeByPidFuzzTest") { + module_out_path = "imf/imf" + + fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandiscurrentimebypid_fuzzer" + + include_dirs = [ + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandiscurrentimebypid_fuzzer", + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", + ] + + sources = [ "commandiscurrentimebypid_fuzzer/commandiscurrentimebypid_fuzzer.cpp" ] + + deps = common_deps + + external_deps = common_external_deps +} + +ohos_fuzztest("CommandIsDefaultImeSetFuzzTest") { + module_out_path = "imf/imf" + + fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandisdefaultimeset_fuzzer" + + include_dirs = [ + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandisdefaultimeset_fuzzer", + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", + ] + + sources = [ "commandisdefaultimeset_fuzzer/commandisdefaultimeset_fuzzer.cpp" ] + + deps = common_deps + + external_deps = common_external_deps +} + +ohos_fuzztest("CommandIsSystemAppSetFuzzTest") { + module_out_path = "imf/imf" + + fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandissystemappset_fuzzer" + + include_dirs = [ + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandissystemappset_fuzzer", + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", + ] + + sources = [ "commandissystemappset_fuzzer/commandissystemappset_fuzzer.cpp" ] + + deps = common_deps + + external_deps = common_external_deps +} + +ohos_fuzztest("CommandGetInputMethodStateFuzzTest") { + module_out_path = "imf/imf" + + fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandgetinputmethodstate_fuzzer" + + include_dirs = [ + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandgetinputmethodstate_fuzzer", + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", + ] + + sources = [ "commandgetinputmethodstate_fuzzer/commandgetinputmethodstate_fuzzer.cpp" ] + + deps = common_deps + + external_deps = common_external_deps +} + +ohos_fuzztest("CommandHideCurrentInputDeprecatedFuzzTest") { + module_out_path = "imf/imf" + + fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandhidecurrentinputdeprecated_fuzzer" + + include_dirs = [ + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandhidecurrentinputdeprecated_fuzzer", + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", + ] + + sources = [ "commandhidecurrentinputdeprecated_fuzzer/commandhidecurrentinputdeprecated_fuzzer.cpp" ] + + deps = common_deps + + external_deps = common_external_deps +} + +ohos_fuzztest("CommandInitConnectFuzzTest") { + module_out_path = "imf/imf" + + fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandinitconnect_fuzzer" + + include_dirs = [ + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandinitconnect_fuzzer", + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", + ] + + sources = [ "commandinitconnect_fuzzer/commandinitconnect_fuzzer.cpp" ] + + deps = common_deps + + external_deps = common_external_deps +} + +ohos_fuzztest("CommandSetCallingWindowFuzzTest") { + module_out_path = "imf/imf" + + fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandsetcallingwindow_fuzzer" + + include_dirs = [ + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandsetcallingwindow_fuzzer", + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", + ] + + sources = [ "commandsetcallingwindow_fuzzer/commandsetcallingwindow_fuzzer.cpp" ] + + deps = common_deps + + external_deps = common_external_deps +} + +ohos_fuzztest("CommandGetInputStartInfoFuzzTest") { + module_out_path = "imf/imf" + + fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandgetinputstartinfo_fuzzer" + + include_dirs = [ + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandgetinputstartinfo_fuzzer", + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", + ] + + sources = [ "commandgetinputstartinfo_fuzzer/commandgetinputstartinfo_fuzzer.cpp" ] + + deps = common_deps + + external_deps = common_external_deps +} + +ohos_fuzztest("CommandRegisterProxyImeFuzzTest") { + module_out_path = "imf/imf" + + fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandregisterproxyime_fuzzer" + + include_dirs = [ + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandregisterproxyime_fuzzer", + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", + ] + + sources = [ "commandregisterproxyime_fuzzer/commandregisterproxyime_fuzzer.cpp" ] + + deps = common_deps + + external_deps = common_external_deps +} + +ohos_fuzztest("CommandUnregisterProxyImeFuzzTest") { + module_out_path = "imf/imf" + + fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandunregisterproxyime_fuzzer" + + include_dirs = [ + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandunregisterproxyime_fuzzer", + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", + ] + + sources = [ "commandunregisterproxyime_fuzzer/commandunregisterproxyime_fuzzer.cpp" ] + + deps = common_deps + + external_deps = common_external_deps +} + +ohos_fuzztest("CommandEnableImeFuzzTest") { + module_out_path = "imf/imf" + + fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandenableime_fuzzer" + + include_dirs = [ + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/commandenableime_fuzzer", + "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common", + ] + + sources = [ "commandenableime_fuzzer/commandenableime_fuzzer.cpp" ] + + deps = common_deps + + external_deps = common_external_deps +} \ No newline at end of file diff --git a/test/fuzztest/systemabilitystubfuzztest/commandenableime_fuzzer/commandenableime_fuzzer.cpp b/test/fuzztest/systemabilitystubfuzztest/commandenableime_fuzzer/commandenableime_fuzzer.cpp new file mode 100644 index 000000000..5416700ec --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandenableime_fuzzer/commandenableime_fuzzer.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "commandenableime_fuzzer.h" + +#include "imf_sa_stub_fuzz_util.h" + +using namespace OHOS::MiscServices; +namespace OHOS { +} // namespace OHOS +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + ImfSaStubFuzzUtil::FuzzInputMethodSystemAbility(data, size, + IInputMethodSystemAbilityIpcCode::COMMAND_ENABLE_IME); + return 0; +} diff --git a/test/fuzztest/systemabilitystubfuzztest/commandenableime_fuzzer/commandenableime_fuzzer.h b/test/fuzztest/systemabilitystubfuzztest/commandenableime_fuzzer/commandenableime_fuzzer.h new file mode 100644 index 000000000..e3066fe62 --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandenableime_fuzzer/commandenableime_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H +#define TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H + +#define FUZZ_PROJECT_NAME "commandenableime_fuzzer" + +#endif // TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H diff --git a/test/fuzztest/systemabilitystubfuzztest/commandenableime_fuzzer/corpus/init b/test/fuzztest/systemabilitystubfuzztest/commandenableime_fuzzer/corpus/init new file mode 100644 index 000000000..e4ceac1bc --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandenableime_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/systemabilitystubfuzztest/commandenableime_fuzzer/project.xml b/test/fuzztest/systemabilitystubfuzztest/commandenableime_fuzzer/project.xml new file mode 100644 index 000000000..4fdbc407f --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandenableime_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/systemabilitystubfuzztest/commandgetinputmethodstate_fuzzer/commandgetinputmethodstate_fuzzer.cpp b/test/fuzztest/systemabilitystubfuzztest/commandgetinputmethodstate_fuzzer/commandgetinputmethodstate_fuzzer.cpp new file mode 100644 index 000000000..abfd0980c --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandgetinputmethodstate_fuzzer/commandgetinputmethodstate_fuzzer.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "commandgetinputmethodstate_fuzzer.h" + +#include "imf_sa_stub_fuzz_util.h" + +using namespace OHOS::MiscServices; +namespace OHOS { +} // namespace OHOS +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + ImfSaStubFuzzUtil::FuzzInputMethodSystemAbility(data, size, + IInputMethodSystemAbilityIpcCode::COMMAND_GET_INPUT_METHOD_STATE); + return 0; +} diff --git a/test/fuzztest/systemabilitystubfuzztest/commandgetinputmethodstate_fuzzer/commandgetinputmethodstate_fuzzer.h b/test/fuzztest/systemabilitystubfuzztest/commandgetinputmethodstate_fuzzer/commandgetinputmethodstate_fuzzer.h new file mode 100644 index 000000000..ca402a0fd --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandgetinputmethodstate_fuzzer/commandgetinputmethodstate_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H +#define TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H + +#define FUZZ_PROJECT_NAME "commandgetinputmethodstate_fuzzer" + +#endif // TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H diff --git a/test/fuzztest/systemabilitystubfuzztest/commandgetinputmethodstate_fuzzer/corpus/init b/test/fuzztest/systemabilitystubfuzztest/commandgetinputmethodstate_fuzzer/corpus/init new file mode 100644 index 000000000..e4ceac1bc --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandgetinputmethodstate_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/systemabilitystubfuzztest/commandgetinputmethodstate_fuzzer/project.xml b/test/fuzztest/systemabilitystubfuzztest/commandgetinputmethodstate_fuzzer/project.xml new file mode 100644 index 000000000..4fdbc407f --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandgetinputmethodstate_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/systemabilitystubfuzztest/commandgetinputstartinfo_fuzzer/commandgetinputstartinfo_fuzzer.cpp b/test/fuzztest/systemabilitystubfuzztest/commandgetinputstartinfo_fuzzer/commandgetinputstartinfo_fuzzer.cpp new file mode 100644 index 000000000..cebae1fef --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandgetinputstartinfo_fuzzer/commandgetinputstartinfo_fuzzer.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "commandgetinputstartinfo_fuzzer.h" + +#include "imf_sa_stub_fuzz_util.h" + +using namespace OHOS::MiscServices; +namespace OHOS { +} // namespace OHOS +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + ImfSaStubFuzzUtil::FuzzInputMethodSystemAbility(data, size, + IInputMethodSystemAbilityIpcCode::COMMAND_GET_INPUT_START_INFO); + return 0; +} diff --git a/test/fuzztest/systemabilitystubfuzztest/commandgetinputstartinfo_fuzzer/commandgetinputstartinfo_fuzzer.h b/test/fuzztest/systemabilitystubfuzztest/commandgetinputstartinfo_fuzzer/commandgetinputstartinfo_fuzzer.h new file mode 100644 index 000000000..6df59942b --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandgetinputstartinfo_fuzzer/commandgetinputstartinfo_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H +#define TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H + +#define FUZZ_PROJECT_NAME "commandgetinputstartinfo_fuzzer" + +#endif // TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H diff --git a/test/fuzztest/systemabilitystubfuzztest/commandgetinputstartinfo_fuzzer/corpus/init b/test/fuzztest/systemabilitystubfuzztest/commandgetinputstartinfo_fuzzer/corpus/init new file mode 100644 index 000000000..e4ceac1bc --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandgetinputstartinfo_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/systemabilitystubfuzztest/commandgetinputstartinfo_fuzzer/project.xml b/test/fuzztest/systemabilitystubfuzztest/commandgetinputstartinfo_fuzzer/project.xml new file mode 100644 index 000000000..4fdbc407f --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandgetinputstartinfo_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/systemabilitystubfuzztest/commandhidecurrentinputdeprecated_fuzzer/commandhidecurrentinputdeprecated_fuzzer.cpp b/test/fuzztest/systemabilitystubfuzztest/commandhidecurrentinputdeprecated_fuzzer/commandhidecurrentinputdeprecated_fuzzer.cpp new file mode 100644 index 000000000..bb96b007e --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandhidecurrentinputdeprecated_fuzzer/commandhidecurrentinputdeprecated_fuzzer.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "commandhidecurrentinputdeprecated_fuzzer.h" + +#include "imf_sa_stub_fuzz_util.h" + +using namespace OHOS::MiscServices; +namespace OHOS { +} // namespace OHOS +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + ImfSaStubFuzzUtil::FuzzInputMethodSystemAbility(data, size, + IInputMethodSystemAbilityIpcCode::COMMAND_HIDE_CURRENT_INPUT_DEPRECATED); + return 0; +} diff --git a/test/fuzztest/systemabilitystubfuzztest/commandhidecurrentinputdeprecated_fuzzer/commandhidecurrentinputdeprecated_fuzzer.h b/test/fuzztest/systemabilitystubfuzztest/commandhidecurrentinputdeprecated_fuzzer/commandhidecurrentinputdeprecated_fuzzer.h new file mode 100644 index 000000000..b7e4d37e3 --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandhidecurrentinputdeprecated_fuzzer/commandhidecurrentinputdeprecated_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H +#define TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H + +#define FUZZ_PROJECT_NAME "commandhidecurrentinputdeprecated_fuzzer" + +#endif // TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H diff --git a/test/fuzztest/systemabilitystubfuzztest/commandhidecurrentinputdeprecated_fuzzer/corpus/init b/test/fuzztest/systemabilitystubfuzztest/commandhidecurrentinputdeprecated_fuzzer/corpus/init new file mode 100644 index 000000000..e4ceac1bc --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandhidecurrentinputdeprecated_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/systemabilitystubfuzztest/commandhidecurrentinputdeprecated_fuzzer/project.xml b/test/fuzztest/systemabilitystubfuzztest/commandhidecurrentinputdeprecated_fuzzer/project.xml new file mode 100644 index 000000000..4fdbc407f --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandhidecurrentinputdeprecated_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/systemabilitystubfuzztest/commandinitconnect_fuzzer/commandinitconnect_fuzzer.cpp b/test/fuzztest/systemabilitystubfuzztest/commandinitconnect_fuzzer/commandinitconnect_fuzzer.cpp new file mode 100644 index 000000000..24eb1c38e --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandinitconnect_fuzzer/commandinitconnect_fuzzer.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "commandinitconnect_fuzzer.h" + +#include "imf_sa_stub_fuzz_util.h" + +using namespace OHOS::MiscServices; +namespace OHOS { +} // namespace OHOS +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + ImfSaStubFuzzUtil::FuzzInputMethodSystemAbility(data, size, + IInputMethodSystemAbilityIpcCode::COMMAND_INIT_CONNECT); + return 0; +} diff --git a/test/fuzztest/systemabilitystubfuzztest/commandinitconnect_fuzzer/commandinitconnect_fuzzer.h b/test/fuzztest/systemabilitystubfuzztest/commandinitconnect_fuzzer/commandinitconnect_fuzzer.h new file mode 100644 index 000000000..ce9463cf0 --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandinitconnect_fuzzer/commandinitconnect_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H +#define TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H + +#define FUZZ_PROJECT_NAME "commandinitconnect_fuzzer" + +#endif // TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H diff --git a/test/fuzztest/systemabilitystubfuzztest/commandinitconnect_fuzzer/corpus/init b/test/fuzztest/systemabilitystubfuzztest/commandinitconnect_fuzzer/corpus/init new file mode 100644 index 000000000..e4ceac1bc --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandinitconnect_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/systemabilitystubfuzztest/commandinitconnect_fuzzer/project.xml b/test/fuzztest/systemabilitystubfuzztest/commandinitconnect_fuzzer/project.xml new file mode 100644 index 000000000..4fdbc407f --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandinitconnect_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/systemabilitystubfuzztest/commandiscurrentimebypid_fuzzer/commandiscurrentimebypid_fuzzer.cpp b/test/fuzztest/systemabilitystubfuzztest/commandiscurrentimebypid_fuzzer/commandiscurrentimebypid_fuzzer.cpp new file mode 100644 index 000000000..2290e999a --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandiscurrentimebypid_fuzzer/commandiscurrentimebypid_fuzzer.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "commandiscurrentimebypid_fuzzer.h" + +#include "imf_sa_stub_fuzz_util.h" + +using namespace OHOS::MiscServices; +namespace OHOS { +} // namespace OHOS +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + ImfSaStubFuzzUtil::FuzzInputMethodSystemAbility(data, size, + IInputMethodSystemAbilityIpcCode::COMMAND_IS_CURRENT_IME_BY_PID); + return 0; +} diff --git a/test/fuzztest/systemabilitystubfuzztest/commandiscurrentimebypid_fuzzer/commandiscurrentimebypid_fuzzer.h b/test/fuzztest/systemabilitystubfuzztest/commandiscurrentimebypid_fuzzer/commandiscurrentimebypid_fuzzer.h new file mode 100644 index 000000000..2229ee51d --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandiscurrentimebypid_fuzzer/commandiscurrentimebypid_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H +#define TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H + +#define FUZZ_PROJECT_NAME "commandiscurrentimebypid_fuzzer" + +#endif // TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H diff --git a/test/fuzztest/systemabilitystubfuzztest/commandiscurrentimebypid_fuzzer/corpus/init b/test/fuzztest/systemabilitystubfuzztest/commandiscurrentimebypid_fuzzer/corpus/init new file mode 100644 index 000000000..e4ceac1bc --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandiscurrentimebypid_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/systemabilitystubfuzztest/commandiscurrentimebypid_fuzzer/project.xml b/test/fuzztest/systemabilitystubfuzztest/commandiscurrentimebypid_fuzzer/project.xml new file mode 100644 index 000000000..4fdbc407f --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandiscurrentimebypid_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/systemabilitystubfuzztest/commandisdefaultimeset_fuzzer/commandisdefaultimeset_fuzzer.cpp b/test/fuzztest/systemabilitystubfuzztest/commandisdefaultimeset_fuzzer/commandisdefaultimeset_fuzzer.cpp new file mode 100644 index 000000000..cf9db3328 --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandisdefaultimeset_fuzzer/commandisdefaultimeset_fuzzer.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "commandisdefaultimeset_fuzzer.h" + +#include "imf_sa_stub_fuzz_util.h" + +using namespace OHOS::MiscServices; +namespace OHOS { +} // namespace OHOS +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + ImfSaStubFuzzUtil::FuzzInputMethodSystemAbility(data, size, + IInputMethodSystemAbilityIpcCode::COMMAND_IS_DEFAULT_IME_SET); + return 0; +} diff --git a/test/fuzztest/systemabilitystubfuzztest/commandisdefaultimeset_fuzzer/commandisdefaultimeset_fuzzer.h b/test/fuzztest/systemabilitystubfuzztest/commandisdefaultimeset_fuzzer/commandisdefaultimeset_fuzzer.h new file mode 100644 index 000000000..bd65a2656 --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandisdefaultimeset_fuzzer/commandisdefaultimeset_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H +#define TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H + +#define FUZZ_PROJECT_NAME "commandisdefaultimeset_fuzzer" + +#endif // TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H diff --git a/test/fuzztest/systemabilitystubfuzztest/commandisdefaultimeset_fuzzer/corpus/init b/test/fuzztest/systemabilitystubfuzztest/commandisdefaultimeset_fuzzer/corpus/init new file mode 100644 index 000000000..e4ceac1bc --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandisdefaultimeset_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/systemabilitystubfuzztest/commandisdefaultimeset_fuzzer/project.xml b/test/fuzztest/systemabilitystubfuzztest/commandisdefaultimeset_fuzzer/project.xml new file mode 100644 index 000000000..4fdbc407f --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandisdefaultimeset_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/systemabilitystubfuzztest/commandissystemappset_fuzzer/commandissystemappset_fuzzer.cpp b/test/fuzztest/systemabilitystubfuzztest/commandissystemappset_fuzzer/commandissystemappset_fuzzer.cpp new file mode 100644 index 000000000..f4f2b3437 --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandissystemappset_fuzzer/commandissystemappset_fuzzer.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "commandissystemappset_fuzzer.h" + +#include "imf_sa_stub_fuzz_util.h" + +using namespace OHOS::MiscServices; +namespace OHOS { +} // namespace OHOS +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + ImfSaStubFuzzUtil::FuzzInputMethodSystemAbility(data, size, + IInputMethodSystemAbilityIpcCode::COMMAND_IS_SYSTEM_APP); + return 0; +} diff --git a/test/fuzztest/systemabilitystubfuzztest/commandissystemappset_fuzzer/commandissystemappset_fuzzer.h b/test/fuzztest/systemabilitystubfuzztest/commandissystemappset_fuzzer/commandissystemappset_fuzzer.h new file mode 100644 index 000000000..3ce0cba75 --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandissystemappset_fuzzer/commandissystemappset_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H +#define TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H + +#define FUZZ_PROJECT_NAME "commandissystemappset_fuzzer" + +#endif // TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H diff --git a/test/fuzztest/systemabilitystubfuzztest/commandissystemappset_fuzzer/corpus/init b/test/fuzztest/systemabilitystubfuzztest/commandissystemappset_fuzzer/corpus/init new file mode 100644 index 000000000..e4ceac1bc --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandissystemappset_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/systemabilitystubfuzztest/commandissystemappset_fuzzer/project.xml b/test/fuzztest/systemabilitystubfuzztest/commandissystemappset_fuzzer/project.xml new file mode 100644 index 000000000..4fdbc407f --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandissystemappset_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/systemabilitystubfuzztest/commandregisterproxyime_fuzzer/commandregisterproxyime_fuzzer.cpp b/test/fuzztest/systemabilitystubfuzztest/commandregisterproxyime_fuzzer/commandregisterproxyime_fuzzer.cpp new file mode 100644 index 000000000..e386f92d9 --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandregisterproxyime_fuzzer/commandregisterproxyime_fuzzer.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "commandregisterproxyime_fuzzer.h" + +#include "imf_sa_stub_fuzz_util.h" + +using namespace OHOS::MiscServices; +namespace OHOS { +} // namespace OHOS +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + ImfSaStubFuzzUtil::FuzzInputMethodSystemAbility(data, size, + IInputMethodSystemAbilityIpcCode::COMMAND_REGISTER_PROXY_IME); + return 0; +} diff --git a/test/fuzztest/systemabilitystubfuzztest/commandregisterproxyime_fuzzer/commandregisterproxyime_fuzzer.h b/test/fuzztest/systemabilitystubfuzztest/commandregisterproxyime_fuzzer/commandregisterproxyime_fuzzer.h new file mode 100644 index 000000000..ab6f46f10 --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandregisterproxyime_fuzzer/commandregisterproxyime_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H +#define TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H + +#define FUZZ_PROJECT_NAME "commandregisterproxyime_fuzzer" + +#endif // TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H diff --git a/test/fuzztest/systemabilitystubfuzztest/commandregisterproxyime_fuzzer/corpus/init b/test/fuzztest/systemabilitystubfuzztest/commandregisterproxyime_fuzzer/corpus/init new file mode 100644 index 000000000..e4ceac1bc --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandregisterproxyime_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/systemabilitystubfuzztest/commandregisterproxyime_fuzzer/project.xml b/test/fuzztest/systemabilitystubfuzztest/commandregisterproxyime_fuzzer/project.xml new file mode 100644 index 000000000..4fdbc407f --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandregisterproxyime_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/systemabilitystubfuzztest/commandsetcallingwindow_fuzzer/commandsetcallingwindow_fuzzer.cpp b/test/fuzztest/systemabilitystubfuzztest/commandsetcallingwindow_fuzzer/commandsetcallingwindow_fuzzer.cpp new file mode 100644 index 000000000..428f4af42 --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandsetcallingwindow_fuzzer/commandsetcallingwindow_fuzzer.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "commandsetcallingwindow_fuzzer.h" + +#include "imf_sa_stub_fuzz_util.h" + +using namespace OHOS::MiscServices; +namespace OHOS { +} // namespace OHOS +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + ImfSaStubFuzzUtil::FuzzInputMethodSystemAbility(data, size, + IInputMethodSystemAbilityIpcCode::COMMAND_SET_CALLING_WINDOW); + return 0; +} diff --git a/test/fuzztest/systemabilitystubfuzztest/commandsetcallingwindow_fuzzer/commandsetcallingwindow_fuzzer.h b/test/fuzztest/systemabilitystubfuzztest/commandsetcallingwindow_fuzzer/commandsetcallingwindow_fuzzer.h new file mode 100644 index 000000000..5d03ea78f --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandsetcallingwindow_fuzzer/commandsetcallingwindow_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H +#define TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H + +#define FUZZ_PROJECT_NAME "commandsetcallingwindow_fuzzer" + +#endif // TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H diff --git a/test/fuzztest/systemabilitystubfuzztest/commandsetcallingwindow_fuzzer/corpus/init b/test/fuzztest/systemabilitystubfuzztest/commandsetcallingwindow_fuzzer/corpus/init new file mode 100644 index 000000000..e4ceac1bc --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandsetcallingwindow_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/systemabilitystubfuzztest/commandsetcallingwindow_fuzzer/project.xml b/test/fuzztest/systemabilitystubfuzztest/commandsetcallingwindow_fuzzer/project.xml new file mode 100644 index 000000000..4fdbc407f --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandsetcallingwindow_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/systemabilitystubfuzztest/commandunregisterproxyime_fuzzer/commandunregisterproxyime_fuzzer.cpp b/test/fuzztest/systemabilitystubfuzztest/commandunregisterproxyime_fuzzer/commandunregisterproxyime_fuzzer.cpp new file mode 100644 index 000000000..46d4d8b0a --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandunregisterproxyime_fuzzer/commandunregisterproxyime_fuzzer.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "commandunregisterproxyime_fuzzer.h" + +#include "imf_sa_stub_fuzz_util.h" + +using namespace OHOS::MiscServices; +namespace OHOS { +} // namespace OHOS +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + /* Run your code on data */ + ImfSaStubFuzzUtil::FuzzInputMethodSystemAbility(data, size, + IInputMethodSystemAbilityIpcCode::COMMAND_UNREGISTER_PROXY_IME); + return 0; +} diff --git a/test/fuzztest/systemabilitystubfuzztest/commandunregisterproxyime_fuzzer/commandunregisterproxyime_fuzzer.h b/test/fuzztest/systemabilitystubfuzztest/commandunregisterproxyime_fuzzer/commandunregisterproxyime_fuzzer.h new file mode 100644 index 000000000..73552569c --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandunregisterproxyime_fuzzer/commandunregisterproxyime_fuzzer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H +#define TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H + +#define FUZZ_PROJECT_NAME "commandunregisterproxyime_fuzzer" + +#endif // TEST_FUZZTEST_UPDATELISTENEVENTFLAG_FUZZER_H diff --git a/test/fuzztest/systemabilitystubfuzztest/commandunregisterproxyime_fuzzer/corpus/init b/test/fuzztest/systemabilitystubfuzztest/commandunregisterproxyime_fuzzer/corpus/init new file mode 100644 index 000000000..e4ceac1bc --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandunregisterproxyime_fuzzer/corpus/init @@ -0,0 +1,14 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FUZZ \ No newline at end of file diff --git a/test/fuzztest/systemabilitystubfuzztest/commandunregisterproxyime_fuzzer/project.xml b/test/fuzztest/systemabilitystubfuzztest/commandunregisterproxyime_fuzzer/project.xml new file mode 100644 index 000000000..4fdbc407f --- /dev/null +++ b/test/fuzztest/systemabilitystubfuzztest/commandunregisterproxyime_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/test/fuzztest/systemabilitystubfuzztest/common/imf_sa_stub_fuzz_util.cpp b/test/fuzztest/systemabilitystubfuzztest/common/imf_sa_stub_fuzz_util.cpp index 8c860b67b..05cd16c27 100644 --- a/test/fuzztest/systemabilitystubfuzztest/common/imf_sa_stub_fuzz_util.cpp +++ b/test/fuzztest/systemabilitystubfuzztest/common/imf_sa_stub_fuzz_util.cpp @@ -115,12 +115,9 @@ bool ImfSaStubFuzzUtil::FuzzInputMethodSystemAbility(const uint8_t *rawData, siz MessageParcel datas; datas.WriteInterfaceToken(SYSTEMABILITY_INTERFACE_TOKEN); + SwitchIpcCode(code, datas); datas.WriteBuffer(rawData, size); datas.RewindRead(0); - auto ret = SwitchIpcCode(code, datas); - if (ret == false) { - return ret; - } MessageParcel reply; MessageOption option; DelayedSingleton::GetInstance()->OnRemoteRequest( -- Gitee