From c8ece4e5a64c71970c8b2d4184e666c91a079a5f Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Wed, 9 Nov 2011 11:41:12 +0100 Subject: [PATCH] Fixed issue #915: TortoiseProc memory corruption on empty repo Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/TortoiseProc/GitLogCache.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Changelog.txt b/src/Changelog.txt index 10e0406c9..5f23e5b40 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -15,6 +15,7 @@ * Fixed issue #951: Alt+S conflict for sign and set date * Fixed issue #949: TortoiseMerge does not allow copying to the clipboard via Ctrl+Insert * Fixed issue #950: avoid possible crash if .git/packed-refs contains annotated tags + * Fixed issue #915: TortoiseProc memory corruption on empty repo = Release 1.7.4.0 = == Features== diff --git a/src/TortoiseProc/GitLogCache.cpp b/src/TortoiseProc/GitLogCache.cpp index 7d98e0623..943585cd7 100644 --- a/src/TortoiseProc/GitLogCache.cpp +++ b/src/TortoiseProc/GitLogCache.cpp @@ -364,12 +364,15 @@ int CLogCache::SaveCache() int ret =0; BOOL bIsRebuild=false; - if( this->m_HashMap.size() == 0 ) + if( this->m_HashMap.size() == 0 ) // is not sufficient, because "working copy changes" are always included return 0; if( this->m_GitDir.IsEmpty()) return 0; + if (this->m_pCacheIndex && m_pCacheIndex->m_Header.m_ItemCount == 0) // check for empty log list (issue #915) + return 0; + SLogCacheIndexFile *pIndex = NULL; if(this->m_pCacheIndex) { -- 2.11.4.GIT