From d40b72310ff2ae50ca7a19b2ed38b638a79003cc Mon Sep 17 00:00:00 2001 From: zgit2021 Date: Tue, 31 Aug 2021 09:34:21 +0000 Subject: [PATCH] fix "remain" overflowed warning. Signed-off-by: zgit2021 --- trans_service/source/libdistbus/tcp_session_manager.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/trans_service/source/libdistbus/tcp_session_manager.c b/trans_service/source/libdistbus/tcp_session_manager.c index 5cb77c4..c1baf66 100644 --- a/trans_service/source/libdistbus/tcp_session_manager.c +++ b/trans_service/source/libdistbus/tcp_session_manager.c @@ -515,6 +515,10 @@ static bool HandleRequestMsg(TcpSession *session) int remain = dataLen; while (remain > 0) { size = TcpRecvData(session->fd, data + total, remain, 0); + if (size < 0) { + SOFTBUS_PRINT("[TRANS] TcpRecvData fail\n"); + return false; + } if (size >= remain) { break; }