mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 23:47:23 -06:00
- Fix detection of invalid torrent files
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.0.6
|
||||||
|
- BUGFIX: Fix detection of invalid torrent files
|
||||||
|
|
||||||
* Web Dec 31 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.5
|
* Web Dec 31 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.5
|
||||||
- BUGFIX: Fix crash with downloaded/availability bars when the torrent has too many pieces
|
- BUGFIX: Fix crash with downloaded/availability bars when the torrent has too many pieces
|
||||||
|
|
||||||
|
|||||||
@@ -794,6 +794,8 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
|
|||||||
try {
|
try {
|
||||||
// Getting torrent file informations
|
// Getting torrent file informations
|
||||||
t = new torrent_info(file.toLocal8Bit().data());
|
t = new torrent_info(file.toLocal8Bit().data());
|
||||||
|
if(!t->is_valid())
|
||||||
|
throw std::exception();
|
||||||
} catch(std::exception&) {
|
} catch(std::exception&) {
|
||||||
if(!from_url.isNull()) {
|
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"));
|
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"));
|
||||||
|
|||||||
@@ -160,6 +160,8 @@ QPoint screenCenter() const{
|
|||||||
// Getting torrent file informations
|
// Getting torrent file informations
|
||||||
try {
|
try {
|
||||||
t = new torrent_info(filePath.toLocal8Bit().data());
|
t = new torrent_info(filePath.toLocal8Bit().data());
|
||||||
|
if(!t->is_valid())
|
||||||
|
throw std::exception();
|
||||||
} catch(std::exception&) {
|
} catch(std::exception&) {
|
||||||
qDebug("Caught error loading torrent");
|
qDebug("Caught error loading torrent");
|
||||||
if(!from_url.isNull()){
|
if(!from_url.isNull()){
|
||||||
|
|||||||
Reference in New Issue
Block a user