From b7773ba11f3c9d16a2e12ca75bb29345cc04757e Mon Sep 17 00:00:00 2001 From: Karol Szuster Date: Sat, 4 Mar 2017 14:14:08 +0100 Subject: [PATCH] Fix sockets crash (#418) --- modules/sockets/sockets.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/sockets/sockets.cpp b/modules/sockets/sockets.cpp index 76c04705..7b3ed877 100644 --- a/modules/sockets/sockets.cpp +++ b/modules/sockets/sockets.cpp @@ -203,9 +203,10 @@ static cell AMX_NATIVE_CALL socket_recv(AMX *amx, cell *params) int current_length = 0; int max_length = length - 1; + const char *buffer = recv_buffer; while(max_length-- && current_length < bytes_received) { - *destination++ = (cell)*recv_buffer++; + *destination++ = (cell)*buffer++; current_length++; }