From c2d5fe251ea3f37a5d76ee71025c908b0c01c193 Mon Sep 17 00:00:00 2001 From: Josh Elsasser Date: Sat, 14 Jan 2006 04:47:38 +0000 Subject: [PATCH] Fix a crash that I introduced with the shared port code. --- libtransmission/peerparse.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libtransmission/peerparse.h b/libtransmission/peerparse.h index c1a423d5a..db8e8ec9c 100644 --- a/libtransmission/peerparse.h +++ b/libtransmission/peerparse.h @@ -459,6 +459,11 @@ static inline int parseBuf( tr_torrent_t * tor, tr_peer_t * peer, return 1; } + if( peer->pos < 68 ) + { + break; + } + if( memcmp( &p[28], inf->hash, 20 ) ) { peer_dbg( "GET handshake, wrong torrent hash" );