From d6a7d0b3437f9a9d82b3fdbfc083809b46a49e01 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Tue, 29 Nov 2016 01:29:09 +0100 Subject: [PATCH] Correctly handle string which is not necessarily null terminated Signed-off-by: Sven Strickroth --- src/TortoiseGitBlame/TortoiseGitBlameDoc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TortoiseGitBlame/TortoiseGitBlameDoc.cpp b/src/TortoiseGitBlame/TortoiseGitBlameDoc.cpp index 487ea4be5..d3e92bb68 100644 --- a/src/TortoiseGitBlame/TortoiseGitBlameDoc.cpp +++ b/src/TortoiseGitBlame/TortoiseGitBlameDoc.cpp @@ -207,9 +207,9 @@ BOOL CTortoiseGitBlameDoc::OnOpenDocument(LPCTSTR lpszPathName,CString Rev) { CString str; if (!m_BlameData.empty()) - CGit::StringAppend(&str, &m_BlameData[0], CP_UTF8); + CGit::StringAppend(&str, &m_BlameData[0], CP_UTF8, (int)m_BlameData.size()); if (!err.empty()) - CGit::StringAppend(&str, &err[0], CP_UTF8); + CGit::StringAppend(&str, &err[0], CP_UTF8, (int)err.size()); MessageBox(nullptr, CString(MAKEINTRESOURCE(IDS_BLAMEERROR)) + L"\n\n" + str, L"TortoiseGitBlame", MB_OK | MB_ICONERROR); return FALSE; -- 2.11.4.GIT