From 5d3e831e9c8141b8720c7b21231bf5ce0a1d975f Mon Sep 17 00:00:00 2001 From: Alexander Gluzsky Date: Sat, 23 Apr 2016 09:53:35 +0000 Subject: 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 --- protocols/JabberG/src/jabber_proto.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 protocols/JabberG/src/jabber_proto.cpp diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp old mode 100644 new mode 100755 index c87952787a..94706e8ca9 --- 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; -- cgit v1.2.3