diff --git a/src/upnp.cpp b/src/upnp.cpp index 002717672..c4f877f24 100644 --- a/src/upnp.cpp +++ b/src/upnp.cpp @@ -778,6 +778,9 @@ void upnp::update_map(rootdevice& d, int const i) if (d.upnp_connection) return; + // this should not happen, but in case it does, don't fail at runtime + if (i >= d.mapping.end_index()) return; + std::shared_ptr me(self()); mapping_t& m = d.mapping[i];