From 246e6baddc16d63fafcdcdbcad191782eb296b07 Mon Sep 17 00:00:00 2001 From: Alexander Gluzsky Date: Sat, 5 Oct 2013 22:34:55 +0000 Subject: another possible crash fix //thx Ache git-svn-id: http://svn.miranda-ng.org/main/trunk@6362 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/New_GPG/src/utilities.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/New_GPG') diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index 52ccac9e3f..05b7182e41 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -495,8 +495,8 @@ std::wstring encrypt_file(HANDLE hContact, TCHAR *filename) name = filename; else name++; - TCHAR *file_out = new TCHAR [_tcslen(filename)+4]; - mir_sntprintf(file_out, _tcslen(name)+7, _T("%s.gpg"), name); + TCHAR *file_out = new TCHAR [_tcslen(filename)+ _tcslen(_T("%s.gpg")) + 1]; + mir_sntprintf(file_out, _tcslen(file_out), _T("%s.gpg"), name); cmd.push_back(szKeyid); if(db_get_b(hcnt, szGPGModuleName, "bAlwaysTrust", 0)) { -- cgit v1.2.3