mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 23:17:21 -06:00
- Make sure the torrent file is valid before loading it
This commit is contained in:
@@ -857,6 +857,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"));
|
||||
|
||||
Reference in New Issue
Block a user