From 3a2bd3c9b1dacfa0d5f7a7ebd7711a513d273794 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Fri, 1 Jan 2016 16:17:10 +0300 Subject: [PATCH] Fix loading corrupted .fastresume file --- src/base/bittorrent/session.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index a4bb4b64f..baa27a019 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -2340,7 +2340,7 @@ bool loadTorrentResumeData(const QByteArray &data, AddTorrentData &out, MagnetUr libt::lazy_entry fast; libt::error_code ec; libt::lazy_bdecode(data.constData(), data.constData() + data.size(), fast, ec); - if ((fast.type() != libt::lazy_entry::dict_t) && !ec) return false; + if (ec || (fast.type() != libt::lazy_entry::dict_t)) return false; out.savePath = Utils::Fs::fromNativePath(Utils::String::fromStdString(fast.dict_find_string_value("qBt-savePath"))); out.ratioLimit = Utils::String::fromStdString(fast.dict_find_string_value("qBt-ratioLimit")).toDouble();