y500 / libtorrent

Automatically exported from code.google.com/p/libtorrent
0 stars 0 forks source link

add_torrent_alert::message() crash with assertion failed #664

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create a torrent that only have a info_hash but no torrent_info 
(add_torrent_params::ti is null)
2. watch for add_torrent_alert
3. call the message() function on that alert

What is the expected output? What do you see instead?

message() should return "added torrent: <info_hash>"

instead message() crashes with an assertion failure: 
/usr/include/boost/smart_ptr/intrusive_ptr.hpp:162: T* 
boost::intrusive_ptr<T>::operator->() const [with T = 
libtorrent::torrent_info]: Assertion `px != 0' failed.

What version of the product are you using? On what operating system?

version 0.16.17

Please provide any additional information below.

The source code is:

"added torrent: %s", !params.url.empty() ? params.url.c_str() : 
params.ti->name().c_str()

it should be:

"added torrent: %s", !params.url.empty() ? params.url.c_str() :
                     params.ti           ? params.ti->name().c_str() :
                                           params->info_hash.to_string()

(alert.cpp line 622)

Original issue reported on code.google.com by sha...@sogilis.com on 19 Aug 2014 at 2:33

GoogleCodeExporter commented 8 years ago
thanks for the report! I've fixed this in the RC_0_16 branch. please confirm 
that the fix works.

Original comment by arvid.no...@gmail.com on 19 Aug 2014 at 7:19

GoogleCodeExporter commented 8 years ago
I backported the commit to the 0.16.17 release and the issue is resolved.
Thank you.

Original comment by sha...@sogilis.com on 20 Aug 2014 at 1:17