From e3a254488b7a904203f2a742ae99602fb2a1a730 Mon Sep 17 00:00:00 2001 From: litiangang4 Date: Wed, 26 Apr 2023 18:35:14 +0800 Subject: [PATCH] =?UTF-8?q?parcel=E5=BA=8F=E5=88=97=E5=8C=96=E6=9C=AA?= =?UTF-8?q?=E6=A0=A1=E9=AA=8Csize?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: litiangang4 --- distributedinput.gni | 2 -- interfaces/ipc/src/start_stop_result_call_back_stub.cpp | 9 ++++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/distributedinput.gni b/distributedinput.gni index 3a1a679..1f7097e 100644 --- a/distributedinput.gni +++ b/distributedinput.gni @@ -16,8 +16,6 @@ distributedinput_path = "//foundation/distributedhardware/distributed_input" distributedhardwarefwk_path = "//foundation/distributedhardware/distributed_hardware_fwk" -window_manager_path = "//foundation/window/window_manager" - common_path = "${distributedinput_path}/common" utils_path = "${distributedinput_path}/utils" diff --git a/interfaces/ipc/src/start_stop_result_call_back_stub.cpp b/interfaces/ipc/src/start_stop_result_call_back_stub.cpp index f94640a..5c41b09 100644 --- a/interfaces/ipc/src/start_stop_result_call_back_stub.cpp +++ b/interfaces/ipc/src/start_stop_result_call_back_stub.cpp @@ -40,8 +40,11 @@ int32_t StartStopResultCallbackStub::OnRemoteRequest( case IStartStopResultCallback::Message::RESULT_START: { std::string srcId = data.ReadString(); std::string sinkId = data.ReadString(); - uint32_t size = data.ReadUint32(); + if (size > IPC_VECTOR_MAX_SIZE) { + DHLOGI("OnRemoteRequest start data size too large."); + return ERR_DH_INPUT_IPC_READ_VALID_FAIL; + } std::vector dhIds; for (uint32_t i = 0; i < size; i++) { std::string dhId = data.ReadString(); @@ -55,6 +58,10 @@ int32_t StartStopResultCallbackStub::OnRemoteRequest( std::string srcId = data.ReadString(); std::string sinkId = data.ReadString(); uint32_t size = data.ReadUint32(); + if (size > IPC_VECTOR_MAX_SIZE) { + DHLOGI("OnRemoteRequest stop data size too large."); + return ERR_DH_INPUT_IPC_READ_VALID_FAIL; + } std::vector dhIds; for (uint32_t i = 0; i < size; i++) { std::string dhId = data.ReadString(); -- Gitee