diff options
author | Alexander Gluzsky <sss123next@list.ru> | 2016-04-23 09:53:35 +0000 |
---|---|---|
committer | Alexander Gluzsky <sss123next@list.ru> | 2016-04-23 09:53:35 +0000 |
commit | 5d3e831e9c8141b8720c7b21231bf5ce0a1d975f (patch) | |
tree | cdb1c1bbada778df5f673a437a5c9a182aaa9440 /protocols/JabberG | |
parent | a6b928a9afdad2e0ce5ac8ae897f6e13670cb80b (diff) |
prootocol:
jabber:
fixed wrong buffer size for pgp encrypted messages
git-svn-id: http://svn.miranda-ng.org/main/trunk@16753 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG')
-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;
|