git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: "Rafaël Carré" <rafael.carre@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [CRASH] git segfaults on invalid binary diff
Date: Mon, 18 Oct 2010 13:40:31 -0400	[thread overview]
Message-ID: <20101018174031.GA9511@sigill.intra.peff.net> (raw)
In-Reply-To: <20101018180632.7eb40628@wai>

On Mon, Oct 18, 2010 at 06:06:32PM +0200, Rafaël Carré wrote:

> I noticed git crashed on a patch generated with:
> git show --full-index --pretty=email <commit>
> 
> (I had forgotten --binary)
> 
> % git --version
> git version 1.7.3.1.120.g38a18
> % mkdir test
> % cd test
> % git init
> Initialized empty Git repository in /home/fun/test/.git/
> % git am ~/bad.diff
> Applying: foo bar
> Segmentation fault (core dumped)
> Patch failed at 0001 foo bar
> When you have resolved this problem run "git am --resolved".
> If you would prefer to skip this patch, instead run "git am --skip".
> To restore the original branch and stop patching run "git am --abort".
> % cat ~/bad.diff

Hmm, the key seems to be applying it in a new repo without the actual
objects. Git will fall back to trying to apply based on the index line,
and that is presumably where the bug is. I'll try to work up a patch.

-Peff

  reply	other threads:[~2010-10-18 17:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-18 16:06 [CRASH] git segfaults on invalid binary diff Rafaël Carré
2010-10-18 17:40 ` Jeff King [this message]
2010-10-18 18:39   ` [PATCH] apply: don't segfault on binary files with missing data 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=20101018174031.GA9511@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=rafael.carre@gmail.com \
    /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).