From a6d13a2df74e48964013aa416e123411b137d737 Mon Sep 17 00:00:00 2001 From: zhouyongfei Date: Sat, 5 Mar 2022 10:56:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhouyongfei --- .../inputmethod_ability/src/input_method_ability.cpp | 9 ++++++--- .../napi/inputmethodengine/src/js_editor_attribute.cpp | 2 -- services/src/input_method_system_ability.cpp | 1 + services/src/platform_callback_stub.cpp | 4 ++++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/frameworks/inputmethod_ability/src/input_method_ability.cpp b/frameworks/inputmethod_ability/src/input_method_ability.cpp index 7e6ddfbb4..7a26b6b37 100644 --- a/frameworks/inputmethod_ability/src/input_method_ability.cpp +++ b/frameworks/inputmethod_ability/src/input_method_ability.cpp @@ -426,7 +426,8 @@ namespace MiscServices { return; } - int32_t InputMethodAbility::GetEnterKeyType() { + int32_t InputMethodAbility::GetEnterKeyType() + { IMSA_HILOGI("InputMethodAbility::GetEnterKeyType"); if (inputDataChannel == nullptr) { @@ -436,7 +437,8 @@ namespace MiscServices { return inputDataChannel->GetEnterKeyType(); } - int32_t InputMethodAbility::GetInputPattern() { + int32_t InputMethodAbility::GetInputPattern() + { IMSA_HILOGI("InputMethodAbility::GetInputPattern"); if (inputDataChannel == nullptr) { @@ -446,7 +448,8 @@ namespace MiscServices { return inputDataChannel->GetInputPattern(); } - void InputMethodAbility::StopInput() { + void InputMethodAbility::StopInput() + { IMSA_HILOGI("InputMethodAbility::StopInput"); if (inputDataChannel == nullptr) { diff --git a/interfaces/kits/js/napi/inputmethodengine/src/js_editor_attribute.cpp b/interfaces/kits/js/napi/inputmethodengine/src/js_editor_attribute.cpp index b833d925d..9612dd992 100644 --- a/interfaces/kits/js/napi/inputmethodengine/src/js_editor_attribute.cpp +++ b/interfaces/kits/js/napi/inputmethodengine/src/js_editor_attribute.cpp @@ -22,8 +22,6 @@ #include "input_method_ability.h" namespace OHOS { namespace MiscServices { -// constexpr size_t ARGC_ZERO = 0; - void JsEditorAttribute::Finalizer(NativeEngine* engine, void* data, void* hint) { IMSA_HILOGI("JsEditorAttribute::Finalizer is called"); diff --git a/services/src/input_method_system_ability.cpp b/services/src/input_method_system_ability.cpp index 177e6fb7c..ed92d258b 100644 --- a/services/src/input_method_system_ability.cpp +++ b/services/src/input_method_system_ability.cpp @@ -884,6 +884,7 @@ namespace MiscServices { IMSA_HILOGI("InputMethodSystemAbility::OnDisplayOptionalInputMethod has no ime"); return; } + std::string defaultIme = ParaHandle::GetDefaultIme(userId_); std::string params = ""; std::vector::iterator it; diff --git a/services/src/platform_callback_stub.cpp b/services/src/platform_callback_stub.cpp index e90a4e77e..352b006d2 100644 --- a/services/src/platform_callback_stub.cpp +++ b/services/src/platform_callback_stub.cpp @@ -34,6 +34,10 @@ namespace MiscServices { int PlatformCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) { + auto descriptorToken = data.ReadInterfaceToken(); + if (descriptorToken != GetDescriptor()) { + return ErrorCode::ERROR_STATUS_UNKNOWN_TRANSACTION; + } switch (code) { case NOTIFY_EVENT: { int eventId = data.ReadInt32(); -- Gitee From a3c6fbf6f3dafdbc1dd4884a4c60ee70a426eacd Mon Sep 17 00:00:00 2001 From: zhouyongfei Date: Sat, 5 Mar 2022 11:23:16 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dfuzz=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhouyongfei --- frameworks/inputmethod_ability/src/input_method_core_proxy.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/frameworks/inputmethod_ability/src/input_method_core_proxy.cpp b/frameworks/inputmethod_ability/src/input_method_core_proxy.cpp index ba952c115..9e24df4b4 100644 --- a/frameworks/inputmethod_ability/src/input_method_core_proxy.cpp +++ b/frameworks/inputmethod_ability/src/input_method_core_proxy.cpp @@ -78,6 +78,7 @@ namespace MiscServices { sptr channelObject = inputControlChannel->AsObject(); if (channelObject == nullptr) { IMSA_HILOGI("InputMethodCoreProxy::InitInputControlChannel channelObject is nullptr"); + return ErrorCode::ERROR_EX_NULL_POINTER; } data.WriteRemoteObject(channelObject); MessageOption option { -- Gitee