fix out-of-bound access in upnp unmap

This commit is contained in:
arvidn 2020-04-02 16:16:18 +02:00 committed by Arvid Norberg
parent dcf3c83d29
commit 2d9513deb0
1 changed files with 1 additions and 1 deletions

View File

@ -1573,7 +1573,7 @@ void upnp::on_upnp_unmap_response(error_code const& e
// free the slot in global mappings
auto pred = [mapping](rootdevice const& rd)
{ return rd.mapping[mapping].protocol == portmap_protocol::none; };
{ return rd.mapping.end_index() <= mapping || rd.mapping[mapping].protocol == portmap_protocol::none; };
if (std::all_of(m_devices.begin(), m_devices.end(), pred))
{
m_mappings[mapping].protocol = portmap_protocol::none;