forked from premiere/premiere-libtorrent
fix to torrent_info constructor to not try to access 0 pointer when loading a 0 size torrent file
This commit is contained in:
parent
81636a894d
commit
0368e444af
|
@ -319,6 +319,13 @@ namespace libtorrent
|
|||
int ret = load_file(filename, buf);
|
||||
if (ret < 0) return;
|
||||
|
||||
if (buf.empty())
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
throw invalid_torrent_file();
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
|
||||
lazy_entry e;
|
||||
lazy_bdecode(&buf[0], &buf[0] + buf.size(), e);
|
||||
std::string error;
|
||||
|
|
Loading…
Reference in New Issue