2009-11-08 12:15:35 +00:00
|
|
|
# Fix crash when trying to call d.get_bitfield on a closed download. Ticket #1825 from libtorrent.rakshasa.no.
|
2009-11-14 21:05:24 +00:00
|
|
|
--- a/src/command_download.cc
|
|
|
|
+++ b/src/command_download.cc
|
|
|
|
@@ -296,6 +296,9 @@
|
2009-11-08 12:15:35 +00:00
|
|
|
|
|
|
|
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()));
|