libgit2 is a portable C implementation of the Git core methods provided as a linkable library with a solid API, allowing to build Git functionality into your application. Prior to 1.8.6 and 1.9.5, gitdeltaapply in src/libgit2/delta.c trusts the attacker-controlled ressz value parsed by hdrsz from a delta object header and passes that amount to git_malloc before validating delta instructions. Malicious pack data supplied through gitclone, gitfetch, gitremotefetch, gitindexerappend, or a local attacker-supplied repository can use a very small multi-level OFSDELTA chain to retain extremely large allocations and exhaust memory. This issue is fixed in versions 1.8.6 and 1.9.5.