diff options
| author | JosJuice <josjuice@gmail.com> | 2026-03-01 11:00:04 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-01 11:00:04 +0100 |
| commit | 792601120c9f410015f143711383f60d4fa059c0 (patch) | |
| tree | 56b1a897fd8728a856299e223c8ea2fab2087521 /Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp | |
| parent | 63fc9d7ca34285cf9217a62abc0156f7ffbc6e80 (diff) | |
| parent | 80762e0575aded7f43addcaab7eb4847589d31db (diff) | |
Merge pull request #14429 from TellowKrinkle/DSUCheckUnwrapIP
DSU: Don't crash on bad hostname
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp b/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp index 2247dabbda..dad0844beb 100644 --- a/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp @@ -260,11 +260,18 @@ void InputBackend::HotplugThreadFunc() list_ports.pad_request_count = SERVER_ASKED_PADS; list_ports.pad_ids = {0, 1, 2, 3}; msg.Finish(); - if (server.m_socket.send(&list_ports, sizeof list_ports, - sf::IpAddress::resolve(server.m_address).value(), - server.m_port) != sf::Socket::Status::Done) + if (std::optional<sf::IpAddress> server_ip = sf::IpAddress::resolve(server.m_address)) { - ERROR_LOG_FMT(CONTROLLERINTERFACE, "DualShockUDPClient HotplugThreadFunc send failed"); + if (server.m_socket.send(&list_ports, sizeof list_ports, *server_ip, server.m_port) != + sf::Socket::Status::Done) + { + ERROR_LOG_FMT(CONTROLLERINTERFACE, "DualShockUDPClient HotplugThreadFunc send failed"); + } + } + else + { + ERROR_LOG_FMT(CONTROLLERINTERFACE, "DualShockUDPClient failed to resolve {}", + server.m_address); } timed_out_servers[i] = true; } |
