From 6e4a8669249ca37b38e9587eaf2cbaf607843254 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Sun, 8 Nov 2009 12:15:35 +0000 Subject: [PATCH] add missing rtorrent patch from #6111 SVN-Revision: 18341 --- net/rtorrent/patches/011-fix-bitfield-crash.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 net/rtorrent/patches/011-fix-bitfield-crash.patch diff --git a/net/rtorrent/patches/011-fix-bitfield-crash.patch b/net/rtorrent/patches/011-fix-bitfield-crash.patch new file mode 100644 index 000000000..67ef2bc3a --- /dev/null +++ b/net/rtorrent/patches/011-fix-bitfield-crash.patch @@ -0,0 +1,15 @@ +# Fix crash when trying to call d.get_bitfield on a closed download. Ticket #1825 from libtorrent.rakshasa.no. +Index: rtorrent/src/command_download.cc +=================================================================== +--- rtorrent/src/command_download.cc (revision 1093) ++++ rtorrent/src/command_download.cc (working copy) +@@ -292,6 +292,9 @@ + + torrent::Object + retrieve_d_bitfield(core::Download* download) { ++ if (!download->download()->file_list()->is_open()) ++ throw torrent::input_error("Cannot retrieve bitfield of closed download."); ++ + const torrent::Bitfield* bitField = download->download()->file_list()->bitfield(); + + return torrent::Object(rak::transform_hex(bitField->begin(), bitField->end())); -- 2.30.2