From 737a5d1accd6197e5afdc4e496456213e14f53e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B7=8D?= <11034079+li-wei-cug@user.noreply.gitee.com> Date: Thu, 26 Sep 2024 21:10:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=96=E9=83=A8=E9=95=BF?= =?UTF-8?q?=E5=BA=A6=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李巍 <11034079+li-wei-cug@user.noreply.gitee.com> --- .../implementation/src/dependency/softbus/softbus_session.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/implementation/src/dependency/softbus/softbus_session.cpp b/services/implementation/src/dependency/softbus/softbus_session.cpp index 73efad2e5..7e7a72d26 100644 --- a/services/implementation/src/dependency/softbus/softbus_session.cpp +++ b/services/implementation/src/dependency/softbus/softbus_session.cpp @@ -27,6 +27,7 @@ namespace OHOS { namespace DistributedHardware { std::shared_ptr SoftbusSession::sessionCallback_ = nullptr; constexpr const char* DM_HITRACE_AUTH_TO_OPPEN_SESSION = "DM_HITRACE_AUTH_TO_OPPEN_SESSION"; +constexpr int32_t DATA_LEN = 65535; static void OnShutdown(int32_t socket, ShutdownReason reason) { @@ -172,7 +173,7 @@ void SoftbusSession::OnSessionClosed(int sessionId) void SoftbusSession::OnBytesReceived(int sessionId, const void *data, unsigned int dataLen) { - if (sessionId < 0 || data == nullptr || dataLen <= 0) { + if (sessionId < 0 || data == nullptr || dataLen <= 0 || dataLen > DATA_LEN) { LOGI("[SOFTBUS]fail to receive data from softbus with sessionId: %{public}d, dataLen: %{public}d.", sessionId, dataLen); return; -- Gitee