From dd51caee94061ea78683f6be6dfbf72d5124b4a1 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 13 Aug 2008 14:19:25 +0000 Subject: [PATCH] #1186: crash by maliciously-crafted .torrent files w/piece length of zero --- libtransmission/metainfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtransmission/metainfo.c b/libtransmission/metainfo.c index 8531f37d5..9e82f70b3 100644 --- a/libtransmission/metainfo.c +++ b/libtransmission/metainfo.c @@ -411,7 +411,7 @@ tr_metainfoParse( const tr_handle * handle, goto fail; } - if( !inf->fileCount || !inf->totalSize ) + if( !inf->fileCount || !inf->totalSize || !inf->pieceSize ) { tr_nerr( inf->name, _( "Torrent is corrupt" ) ); /* the content is missing! */ goto fail;