git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed check for empty pair in rlm_stg.
[stg.git]
/
stglibs
/
srvconf.lib
/
netunit.cpp
diff --git
a/stglibs/srvconf.lib/netunit.cpp
b/stglibs/srvconf.lib/netunit.cpp
index df0af7f2c446512332ff4af3f353ea6b9429b831..61dc5c69a16cca574c04e0de59009564632dd59d 100644
(file)
--- 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];
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;
if (send(outerSocket, buffer, sizeof(buffer), 0) <= 0)
{
errorMsg = SEND_DATA_ERROR;