-char buffer[text.length()];
-EncryptString(buffer, text.c_str(), text.length(), &ctx);
-if (send(outerSocket, buffer, text.length(), 0) <= 0)
+char buffer[text.length() + 9];
+EncryptString(buffer, text.c_str(), text.length() + 1, &ctx);
+if (send(outerSocket, buffer, sizeof(buffer), 0) <= 0)