summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/network')
-rw-r--r--src/network/core/udp.cpp2
-rw-r--r--src/network/network.cpp1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/network/core/udp.cpp b/src/network/core/udp.cpp
index 31ae8a446..110cec2f2 100644
--- a/src/network/core/udp.cpp
+++ b/src/network/core/udp.cpp
@@ -101,6 +101,8 @@ void NetworkUDPSocketHandler::SendPacket(Packet *p, NetworkAddress *recv)
void NetworkUDPSocketHandler::ReceivePackets()
{
struct sockaddr_storage client_addr;
+ memset(&client_addr, 0, sizeof(client_addr));
+
socklen_t client_len;
int nbytes;
Packet p(this);
diff --git a/src/network/network.cpp b/src/network/network.cpp
index e88b7a1f8..ebd10980d 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -480,6 +480,7 @@ static void NetworkAcceptClients()
assert(_listensocket != INVALID_SOCKET);
for (;;) {
+ memset(&sin, 0, sizeof(sin));
socklen_t sin_len = sizeof(sin);
SOCKET s = accept(_listensocket, (struct sockaddr*)&sin, &sin_len);
if (s == INVALID_SOCKET) return;