mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-24 23:11:14 +01:00
Merge pull request #11083 from sepalani/bba-check
BBA/BuiltIn: Fix a crash during network stack exhaustion
This commit is contained in:
commit
f106bc150a
@ -510,7 +510,7 @@ void CEXIETHERNET::BuiltInBBAInterface::HandleUDPFrame(const Common::UDPPacket&
|
|||||||
void CEXIETHERNET::BuiltInBBAInterface::HandleUPnPClient()
|
void CEXIETHERNET::BuiltInBBAInterface::HandleUPnPClient()
|
||||||
{
|
{
|
||||||
StackRef* ref = GetAvailableSlot(0);
|
StackRef* ref = GetAvailableSlot(0);
|
||||||
if (m_upnp_httpd.accept(ref->tcp_socket) != sf::Socket::Done)
|
if (ref == nullptr || m_upnp_httpd.accept(ref->tcp_socket) != sf::Socket::Done)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ref->tcp_socket.GetPeerName(&ref->from) != sf::Socket::Status::Done ||
|
if (ref->tcp_socket.GetPeerName(&ref->from) != sf::Socket::Status::Done ||
|
||||||
@ -520,6 +520,13 @@ void CEXIETHERNET::BuiltInBBAInterface::HandleUPnPClient()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_current_ip == ref->from.sin_addr.s_addr)
|
||||||
|
{
|
||||||
|
ref->tcp_socket.disconnect();
|
||||||
|
WARN_LOG_FMT(SP1, "Ignoring UPnP request to itself");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ref->delay = GetTickCountStd();
|
ref->delay = GetTickCountStd();
|
||||||
ref->ip = ref->from.sin_addr.s_addr;
|
ref->ip = ref->from.sin_addr.s_addr;
|
||||||
ref->local = ref->to.sin_port;
|
ref->local = ref->to.sin_port;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user