fix out-of-bound access in upnp unmap
This commit is contained in:
parent
dcf3c83d29
commit
2d9513deb0
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue