fix NAT-PMP crash when removing a mapping at the wrong time

This commit is contained in:
arvidn 2017-05-20 07:06:11 -04:00 committed by Arvid Norberg
parent 56d5d795bf
commit 83735fdbb4
2 changed files with 3 additions and 1 deletions

View File

@ -1,3 +1,4 @@
* fix NAT-PMP crash when removing a mapping at the wrong time
* improve path sanitization (filter unicode text direction characters)
* deprecate partial_piece_info::piece_state
* bind upnp requests to correct local address

View File

@ -279,7 +279,8 @@ void natpmp::try_next_mapping(int i, mutex::scoped_lock& l)
std::vector<mapping_t>::iterator m = std::find_if(
m_mappings.begin(), m_mappings.end()
, boost::bind(&mapping_t::action, _1) != int(mapping_t::action_none));
, boost::bind(&mapping_t::action, _1) != int(mapping_t::action_none)
&& boost::bind(&mapping_t::protocol, _1) != int(none));
if (m == m_mappings.end())
{