Skip to content

Commit

Permalink
Fix access to invalid data on reception of packet with size 0
Browse files Browse the repository at this point in the history
  • Loading branch information
sapier authored and sapier committed Sep 6, 2014
1 parent 8948907 commit 944e79d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/connection.cpp
Expand Up @@ -2143,7 +2143,9 @@ void ConnectionReceiveThread::receive()
LOG(derr_con<<m_connection->getDesc()
<<"Receive(): Invalid incoming packet, "
<<"size: " << received_size
<<", protocol: " << readU32(&packetdata[0]) <<std::endl);
<<", protocol: "
<< ((received_size >= 4) ? readU32(&packetdata[0]) : -1)
<< std::endl);
continue;
}

Expand Down

0 comments on commit 944e79d

Please sign in to comment.