]> git.stg.codes - stg.git/commitdiff
Encrypt including the last \0.
authorMaxim Mamontov <faust.madf@gmail.com>
Sun, 25 Jan 2015 18:20:15 +0000 (20:20 +0200)
committerMaxim Mamontov <faust.madf@gmail.com>
Sun, 25 Jan 2015 18:20:15 +0000 (20:20 +0200)
stglibs/srvconf.lib/netunit.cpp

index df0af7f2c446512332ff4af3f353ea6b9429b831..61dc5c69a16cca574c04e0de59009564632dd59d 100644 (file)
@@ -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;