Trap a zero-length message.

This commit is contained in:
JoelKatz
2012-07-06 01:18:12 -07:00
parent 272067061a
commit 3cab7da1f4

View File

@@ -326,7 +326,7 @@ void Peer::handle_read_header(const boost::system::error_code& error)
{
unsigned msg_len = PackedMessage::getLength(mReadbuf);
// WRITEME: Compare to maximum message length, abort if too large
if (msg_len>(32*1024*1024))
if ((msg_len > (32 * 1024 * 1024)) || (msg_len == 0))
{
detach("hrh");
return;