From a9c3ec4006a2297c7c3050ef15bedb9eb89c15bc Mon Sep 17 00:00:00 2001 From: Jack Garrard Date: Wed, 26 Oct 2022 02:43:02 -0700 Subject: [PATCH] Fix a stack exhausion bug --- source/server/SocketClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/server/SocketClient.cpp b/source/server/SocketClient.cpp index 0f944b3..dc31092 100644 --- a/source/server/SocketClient.cpp +++ b/source/server/SocketClient.cpp @@ -199,7 +199,7 @@ bool SocketClient::recv() { } int headerSize = sizeof(Packet); - char headerBuf[MAXPACKSIZE * 2] = {}; + char headerBuf[MAXPACKSIZE + 1] = {0}; int valread = 0; const int fd_count = 2;