git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: worley@alum.mit.edu (Dale R. Worley)
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: "git fsck" fails on malloc of 80 G
Date: Wed, 18 Dec 2013 16:08:47 -0500	[thread overview]
Message-ID: <201312182108.rBIL8lAo015570@hobgoblin.ariadne.com> (raw)
In-Reply-To: <20131216191500.GD29324@sigill.intra.peff.net>

> From: Jeff King <peff@peff.net>

> One of the problems I ran into recently is that
> corrupt data can cause it to make a large allocation

One thing I notice is that in unpack_compressed_entry() in
sha1_file.c, there is a mallocz of "size" bytes.  It appears that
"size" is the size of the object that is being unpacked.  If so, this
code cannot be correct, because it assumes that any file that is
stored in the repository can be put into a buffer allocated in RAM.

Dale

  parent reply	other threads:[~2013-12-18 22:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16 16:05 "git fsck" fails on malloc of 80 G Dale R. Worley
2013-12-16 19:15 ` Jeff King
2013-12-18  3:06   ` Dale R. Worley
2013-12-18 21:58     ` Jeff King
2013-12-18 21:08   ` Dale R. Worley [this message]
2013-12-18 22:09     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201312182108.rBIL8lAo015570@hobgoblin.ariadne.com \
    --to=worley@alum.mit.edu \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).