From 5706879913b24998078a1a99d4abd68480799891 Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Sun, 25 Jan 2015 20:20:15 +0200 Subject: [PATCH] Encrypt including the last \0. --- stglibs/srvconf.lib/netunit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stglibs/srvconf.lib/netunit.cpp b/stglibs/srvconf.lib/netunit.cpp index df0af7f2..61dc5c69 100644 --- a/stglibs/srvconf.lib/netunit.cpp +++ b/stglibs/srvconf.lib/netunit.cpp @@ -312,7 +312,8 @@ BLOWFISH_CTX ctx; InitContext(password.c_str(), PASSWD_LEN, &ctx); size_t length = strlen(text); char buffer[length + 9]; -EncryptString(buffer, text, length, &ctx); +memset(buffer, 0, sizeof(buffer)); +EncryptString(buffer, text, length + 1, &ctx); if (send(outerSocket, buffer, sizeof(buffer), 0) <= 0) { errorMsg = SEND_DATA_ERROR; -- 2.43.2