diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index bf0a6a501..62712d5f6 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -2691,6 +2691,8 @@ namespace libtorrent TORRENT_ASSERT(!m_disk_recv_buffer); TORRENT_ASSERT(disk_buffer_size <= 16 * 1024); + if (disk_buffer_size == 0) return true; + if (disk_buffer_size > 16 * 1024) { disconnect("invalid piece size", 2);