From d531e27ac052a2b74cf09ba866f6f25e6ae13617 Mon Sep 17 00:00:00 2001 From: Mr_Goldberg Date: Tue, 23 Jun 2020 07:19:45 -0400 Subject: [PATCH] Fixed potential bug. Thanks to Nemirtingas for finding it. --- dll/steam_networking.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dll/steam_networking.h b/dll/steam_networking.h index 46769a0..f225bf5 100644 --- a/dll/steam_networking.h +++ b/dll/steam_networking.h @@ -149,8 +149,9 @@ void remove_connection(CSteamID id) SNetSocket_t create_connection_socket(CSteamID target, int nVirtualPort, uint32 nIP, uint16 nPort, SNetListenSocket_t id=0, enum steam_socket_connection_status status=SOCKET_CONNECTING, SNetSocket_t other_id=0) { static SNetSocket_t socket_number = 0; - bool found = 0; + bool found; do { + found = false; ++socket_number; for (auto & c: connection_sockets) { if (c.id == socket_number || socket_number == 0) {