diff --git a/ChangeLog b/ChangeLog index d8d8817ed..38d4606fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -76,6 +76,9 @@ * almost completely changed the storage interface (for custom storage) * added support for hashing pieces in multiple threads +1.0.7 release + + * introduce run-time check for torrent info-sections beeing too large * fix web seed bug when using proxy and proxy-peer-connections=false * fix bug in magnet link parser * introduce add_torrent_params flags to merge web seeds with resume data diff --git a/simulation/libsimulator b/simulation/libsimulator index 47ccf576c..518a846fa 160000 --- a/simulation/libsimulator +++ b/simulation/libsimulator @@ -1 +1 @@ -Subproject commit 47ccf576c6ed7700752ba294962d8e297b1ce76f +Subproject commit 518a846fa769757799a6aa3fec869c5d912ff486 diff --git a/src/torrent_info.cpp b/src/torrent_info.cpp index baf4d198d..92922743b 100644 --- a/src/torrent_info.cpp +++ b/src/torrent_info.cpp @@ -1152,6 +1152,13 @@ namespace libtorrent h.update(section.first, section.second); m_info_hash = h.final(); + // the internal metadata size is only 24 bits + if (section.second >= (2<<24)) + { + ec = errors::metadata_too_large; + return false; + } + // copy the info section m_info_section_size = section.second; m_info_section.reset(new char[m_info_section_size]);