From 0686da47a667c40643eb94e7157ecde1bdc8a472 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 2 Aug 2005 08:39:17 +0000 Subject: [PATCH] Fixed crash bug --- dlls/sockets/sockets.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/sockets/sockets.cpp b/dlls/sockets/sockets.cpp index 6087dd6f..f1b5e8ff 100755 --- a/dlls/sockets/sockets.cpp +++ b/dlls/sockets/sockets.cpp @@ -149,6 +149,11 @@ static cell AMX_NATIVE_CALL socket_recv(AMX *amx, cell *params) /* 2 param */ memset(tmpchar, 0, length); // Now we recieve tmp = recv(socket, tmpchar, length-1, 0); + if (tmp == SOCKET_ERROR) + { + delete [] tmpchar; + return SOCKET_ERROR; + } // And put a copy of our recieved data into amx's string tmpchar[tmp]='\0'; int nlen = 0;