Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • TortoiseGit TortoiseGit
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 380
    • Issues 380
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • TortoiseGitTortoiseGit
  • TortoiseGitTortoiseGit
  • Issues
  • #915
Closed
Open
Issue created Aug 02, 2015 by Sven Strickroth@mrtuxOwner

TortoiseProc memory corruption on empty repo

By isciu... on September 27, 2011 14:12 (imported from Google Code)


What steps will reproduce the problem?

  1. Init the new empty git repository (or clone this empty repo from anywhere).
  2. Click the "Show Log" from the TortoiseGit shell menu, then close the log window.
  3. Do the second step one more time.

What is the expected output? What do you see instead?
Log window should open, but TortoiseProc crashes instead.

What version of the product are you using? On what operating system?
TortoiseGit 1.7.3.0 64bit, Windows 7 x64

Please provide any additional information below.
Memory corruption occurs inside the /src/TortoiseProc/GitLogCache.cpp:

381: memcpy(pIndex,this->m_pCacheIndex,
382: sizeof(SLogCacheIndexFile) + sizeof(SLogCacheIndexItem) *( m_pCacheIndex->m_Header.m_ItemCount-1)
383: );

m_pCacheIndex->m_Header.m_ItemCount may be 0, which happens exactly in the empty repo, memcpy is given 0xffffffff bytes copy, and it corrupts the heap.
In our case, the first "Show Log" command will initialize the tortoisegit.index with no elements, while the second command causes the crash.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking