]> git.stg.codes - stg.git/blobdiff - stglibs/srvconf.lib/netunit.cpp
Merge remote-tracking branch 'origin/ticket42' into stg-2.409
[stg.git] / 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;