Skip to content

Commit 944e79d

Browse files
sapiersapier
sapier
authored and
sapier
committedSep 6, 2014
Fix access to invalid data on reception of packet with size 0
1 parent 8948907 commit 944e79d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/connection.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -2143,7 +2143,9 @@ void ConnectionReceiveThread::receive()
21432143
LOG(derr_con<<m_connection->getDesc()
21442144
<<"Receive(): Invalid incoming packet, "
21452145
<<"size: " << received_size
2146-
<<", protocol: " << readU32(&packetdata[0]) <<std::endl);
2146+
<<", protocol: "
2147+
<< ((received_size >= 4) ? readU32(&packetdata[0]) : -1)
2148+
<< std::endl);
21472149
continue;
21482150
}
21492151

0 commit comments

Comments
 (0)
Please sign in to comment.