aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32.c
diff options
context:
space:
mode:
authorMaxim <[email protected]>2020-04-07 12:33:26 +0200
committerGitHub <[email protected]>2020-04-07 12:33:26 +0200
commit92bf2d8256a5b87e6de9f7305d26148642b68fd2 (patch)
treece9297a53efb01af2cf8de1de2f384715afa78e1 /win32.c
parent33c7d6903e843d450eb18769d5802e83de538825 (diff)
downloadenet-92bf2d8256a5b87e6de9f7305d26148642b68fd2.tar.gz
enet-92bf2d8256a5b87e6de9f7305d26148642b68fd2.zip
Make recvLength = 0; In the rare case of it having bogus data.
I noticed from testing this that this might be the source of it, I once had a package returned with length total bogus. like 982349829 or something like that, it crashed my game, I suspect this is the source.
Diffstat (limited to 'win32.c')
-rw-r--r--win32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/win32.c b/win32.c
index 81175a4..687aa9f 100644
--- a/win32.c
+++ b/win32.c
@@ -354,7 +354,7 @@ enet_socket_receive (ENetSocket socket,
{
INT sinLength = sizeof (struct sockaddr_in);
DWORD flags = 0,
- recvLength;
+ recvLength = 0;
struct sockaddr_in sin;
if (WSARecvFrom (socket,