diff options
-rwxr-xr-x[-rw-r--r--] | protocols/JabberG/src/jabber_proto.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index c87952787a..94706e8ca9 100644..100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -961,8 +961,8 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int, const char* pszSrc) int isEncrypted, id = SerialNext();
if (!strncmp(pszSrc, PGP_PROLOG, mir_strlen(PGP_PROLOG))) {
const char *szEnd = strstr(pszSrc, PGP_EPILOG);
- char *tempstring = (char*)alloca(mir_strlen(pszSrc) + 1);
- size_t nStrippedLength = mir_strlen(pszSrc) - mir_strlen(PGP_PROLOG) - (szEnd ? mir_strlen(szEnd) : 0);
+ char *tempstring = (char*)alloca(mir_strlen(pszSrc) + 2);
+ size_t nStrippedLength = mir_strlen(pszSrc) - mir_strlen(PGP_PROLOG) - (szEnd ? mir_strlen(szEnd) : 0) + 1;
strncpy_s(tempstring, nStrippedLength, pszSrc + mir_strlen(PGP_PROLOG), _TRUNCATE);
tempstring[nStrippedLength] = 0;
pszSrc = tempstring;
|