From e2e575f3a1b30b3be2695a8537863104f5b4d23b Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sun, 21 Dec 2014 00:38:29 +0100 Subject: [PATCH] Update libgit2 Signed-off-by: Sven Strickroth --- ext/build/libgit2.vcxproj | 13 ++++++++ ext/build/libgit2.vcxproj.filters | 39 ++++++++++++++++++++++ ext/libgit2 | 2 +- src/Changelog.txt | 3 ++ src/Git/Git.cpp | 4 +-- src/TGitCache/TGITCache.cpp | 4 +-- src/TortoiseGitBlame/TortoiseGitBlame.cpp | 4 +-- src/TortoiseMerge/TortoiseMerge.cpp | 4 +-- .../ProgressCommands/FetchProgressCommand.cpp | 2 +- src/TortoiseProc/TortoiseProc.cpp | 4 +-- src/TortoiseShell/TortoiseGIT.cpp | 2 +- 11 files changed, 68 insertions(+), 13 deletions(-) diff --git a/ext/build/libgit2.vcxproj b/ext/build/libgit2.vcxproj index c8331a6a4..c2cec5a1b 100644 --- a/ext/build/libgit2.vcxproj +++ b/ext/build/libgit2.vcxproj @@ -60,6 +60,7 @@ + @@ -129,6 +130,7 @@ + @@ -143,6 +145,7 @@ + @@ -168,6 +171,7 @@ + Create @@ -197,18 +201,21 @@ + + + @@ -228,10 +235,12 @@ + + @@ -268,6 +277,7 @@ + @@ -304,8 +314,10 @@ + + @@ -325,6 +337,7 @@ + diff --git a/ext/build/libgit2.vcxproj.filters b/ext/build/libgit2.vcxproj.filters index 01cd01c8e..8ebeae327 100644 --- a/ext/build/libgit2.vcxproj.filters +++ b/ext/build/libgit2.vcxproj.filters @@ -455,6 +455,18 @@ Source Files + + Source Files + + + Source Files + + + Source Files + + + Source Files\win32 + @@ -1018,6 +1030,33 @@ Public Header Files + + Public Header Files + + + Public Header Files + + + Public Header Files + + + Public Header Files\sys + + + Header Files + + + Source Files\hash + + + Header Files\win32 + + + Header Files + + + Header Files + diff --git a/ext/libgit2 b/ext/libgit2 index a6ed1fcbe..6afc0bfad 160000 --- a/ext/libgit2 +++ b/ext/libgit2 @@ -1 +1 @@ -Subproject commit a6ed1fcbe1dbd78dbfd83da3dcff12ed37134e96 +Subproject commit 6afc0bfad921a16711d4dcac90c0eabdf4d12ffa diff --git a/src/Changelog.txt b/src/Changelog.txt index ecca54083..196450320 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -5,6 +5,9 @@ Released: unreleased * Fixed issue #2359: Selected files counter not updated after revert * Fixed issue #2362: git.exe get stuck on Win XP * Fixed issue #2372: Remote Config Tags Dropdown doesn't enable Apply-Button when switching to Reachable + * Updated libgit2 in order to fix CVE-2014-9390. + TortoiseGit is not affected in its default configuration (libgit2 has to be manually enabled for cloning). + Git for Windows and mSysGit < 1.9.5 are affected, so an update highly recommended. = Release 1.8.12.0 = Released: 2014-11-25 diff --git a/src/Git/Git.cpp b/src/Git/Git.cpp index 2a6f66aa5..0e91ddebd 100644 --- a/src/Git/Git.cpp +++ b/src/Git/Git.cpp @@ -1696,7 +1696,7 @@ int CGit::GetRemoteTags(const CString& remote, STRING_VECTOR& list) CStringA remoteA = CUnicodeUtils::GetUTF8(remote); CAutoRemote remote; - if (git_remote_load(remote.GetPointer(), repo, remoteA) < 0) + if (git_remote_lookup(remote.GetPointer(), repo, remoteA) < 0) return -1; git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; @@ -1758,7 +1758,7 @@ int CGit::DeleteRemoteRefs(const CString& sRemote, const STRING_VECTOR& list) CStringA remoteA = CUnicodeUtils::GetUTF8(sRemote); CAutoRemote remote; - if (git_remote_load(remote.GetPointer(), repo, remoteA) < 0) + if (git_remote_lookup(remote.GetPointer(), repo, remoteA) < 0) return -1; git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; diff --git a/src/TGitCache/TGITCache.cpp b/src/TGitCache/TGITCache.cpp index 5ae6e9f2a..f793204c8 100644 --- a/src/TGitCache/TGITCache.cpp +++ b/src/TGitCache/TGITCache.cpp @@ -71,7 +71,7 @@ class CGit2InitClass public: ~CGit2InitClass() { - git_threads_shutdown(); + git_libgit2_shutdown(); } } git2init; @@ -152,7 +152,7 @@ void HandleRestart() int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR lpCmdLine, int /*cmdShow*/) { SetDllDirectory(L""); - git_threads_init(); + git_libgit2_init(); HandleCommandLine(lpCmdLine); CAutoGeneralHandle hReloadProtection = ::CreateMutex(NULL, FALSE, GetCacheMutexName()); diff --git a/src/TortoiseGitBlame/TortoiseGitBlame.cpp b/src/TortoiseGitBlame/TortoiseGitBlame.cpp index 815bae372..367d687f7 100644 --- a/src/TortoiseGitBlame/TortoiseGitBlame.cpp +++ b/src/TortoiseGitBlame/TortoiseGitBlame.cpp @@ -63,7 +63,7 @@ CTortoiseGitBlameApp::CTortoiseGitBlameApp() CCrashReport::Instance().AddUserInfoToReport(L"CommandLine", GetCommandLine()); #endif EnableHtmlHelp(); - git_threads_init(); + git_libgit2_init(); m_nAppLook = 0; m_gdiplusToken = NULL; m_bHiColorIcons = TRUE; @@ -71,7 +71,7 @@ CTortoiseGitBlameApp::CTortoiseGitBlameApp() CTortoiseGitBlameApp::~CTortoiseGitBlameApp() { - git_threads_shutdown(); + git_libgit2_shutdown(); } // The one and only CTortoiseGitBlameApp object diff --git a/src/TortoiseMerge/TortoiseMerge.cpp b/src/TortoiseMerge/TortoiseMerge.cpp index 75ac5d1c0..6aabb92e8 100644 --- a/src/TortoiseMerge/TortoiseMerge.cpp +++ b/src/TortoiseMerge/TortoiseMerge.cpp @@ -70,12 +70,12 @@ CTortoiseMergeApp::CTortoiseMergeApp() { EnableHtmlHelp(); m_bHiColorIcons = TRUE; - git_threads_init(); + git_libgit2_init(); } CTortoiseMergeApp::~CTortoiseMergeApp() { - git_threads_shutdown(); + git_libgit2_shutdown(); } // The one and only CTortoiseMergeApp object diff --git a/src/TortoiseProc/ProgressCommands/FetchProgressCommand.cpp b/src/TortoiseProc/ProgressCommands/FetchProgressCommand.cpp index dfc79a770..a1fcbc0e6 100644 --- a/src/TortoiseProc/ProgressCommands/FetchProgressCommand.cpp +++ b/src/TortoiseProc/ProgressCommands/FetchProgressCommand.cpp @@ -46,7 +46,7 @@ bool FetchProgressCommand::Run(CGitProgressList* list, CString& sWindowTitle, in CAutoRemote remote; // first try with a named remote (e.g. "origin") - if (git_remote_load(remote.GetPointer(), repo, url) < 0) + if (git_remote_lookup(remote.GetPointer(), repo, url) < 0) { // retry with repository located at a specific url if (git_remote_create_anonymous(remote.GetPointer(), repo, url, nullptr) < 0) diff --git a/src/TortoiseProc/TortoiseProc.cpp b/src/TortoiseProc/TortoiseProc.cpp index b8f9c240e..59d73d0a1 100644 --- a/src/TortoiseProc/TortoiseProc.cpp +++ b/src/TortoiseProc/TortoiseProc.cpp @@ -69,7 +69,7 @@ CTortoiseProcApp::CTortoiseProcApp() EnableHtmlHelp(); SYS_IMAGE_LIST(); CHooks::Create(); - git_threads_init(); + git_libgit2_init(); CGit::SetGit2CredentialCallback(CAppUtils::Git2GetUserPassword); CGit::SetGit2CertificateCheckCertificate(CAppUtils::Git2CertificateCheck); m_bLoadUserToolbars = FALSE; @@ -85,7 +85,7 @@ CTortoiseProcApp::~CTortoiseProcApp() { CHooks::Destroy(); SYS_IMAGE_LIST().Cleanup(); - git_threads_shutdown(); + git_libgit2_shutdown(); } // The one and only CTortoiseProcApp object diff --git a/src/TortoiseShell/TortoiseGIT.cpp b/src/TortoiseShell/TortoiseGIT.cpp index 01f502499..b97a9ceab 100644 --- a/src/TortoiseShell/TortoiseGIT.cpp +++ b/src/TortoiseShell/TortoiseGIT.cpp @@ -157,7 +157,7 @@ STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvOut) if (pcf == NULL) return E_OUTOFMEMORY; // refcount currently set to 0 - git_threads_init(); + git_libgit2_init(); const HRESULT hr = pcf->QueryInterface(riid, ppvOut); if(FAILED(hr)) delete pcf; -- 2.11.4.GIT