diff --git a/Changelog b/Changelog index 140e7b725..f63bd26ac 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,6 @@ +* Unreleased - Christophe Dumez - v2.0.6 + - BUGFIX: Fix detection of invalid torrent files + * Web Dec 31 2009 - Christophe Dumez - v2.0.5 - BUGFIX: Fix crash with downloaded/availability bars when the torrent has too many pieces diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 1cc9ceb5e..bff682f35 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -794,6 +794,8 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr try { // Getting torrent file informations t = new torrent_info(file.toLocal8Bit().data()); + if(!t->is_valid()) + throw std::exception(); } catch(std::exception&) { if(!from_url.isNull()) { addConsoleMessage(tr("Unable to decode torrent file: '%1'", "e.g: Unable to decode torrent file: '/home/y/xxx.torrent'").arg(from_url), QString::fromUtf8("red")); diff --git a/src/torrentadditiondlg.h b/src/torrentadditiondlg.h index eaea0edba..1f4609941 100644 --- a/src/torrentadditiondlg.h +++ b/src/torrentadditiondlg.h @@ -160,6 +160,8 @@ QPoint screenCenter() const{ // Getting torrent file informations try { t = new torrent_info(filePath.toLocal8Bit().data()); + if(!t->is_valid()) + throw std::exception(); } catch(std::exception&) { qDebug("Caught error loading torrent"); if(!from_url.isNull()){