From e11ff89e92d2d4343a26f1b0d988dea795561da7 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 4 Oct 2019 04:25:43 -0700 Subject: IVGCVSW-3949 Fix signed/unsigned comparison bug Change-Id: I6a7a809e2d30f137f8221a7d30091d3d6821c213 Signed-off-by: Jim Flynn --- src/profiling/SocketProfilingConnection.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/profiling/SocketProfilingConnection.cpp b/src/profiling/SocketProfilingConnection.cpp index 47fc62f7f0..45b7f9dcfe 100644 --- a/src/profiling/SocketProfilingConnection.cpp +++ b/src/profiling/SocketProfilingConnection.cpp @@ -125,7 +125,12 @@ Packet SocketProfilingConnection::ReadPacket(uint32_t timeout) packetData = std::make_unique(dataLength); } - if (dataLength != recv(m_Socket[0].fd, packetData.get(), dataLength, 0)) + ssize_t receivedLength = recv(m_Socket[0].fd, packetData.get(), dataLength, 0); + if (receivedLength < 0) + { + throw armnn::RuntimeException(std::string("Error occured on recv: ") + strerror(errno)); + } + if (dataLength != static_cast(receivedLength)) { // What do we do here if we can't read in a full packet? throw armnn::RuntimeException("Invalid MIPE packet"); -- cgit v1.2.1