list mirror (unofficial, one of many)
 help / color / Atom feed
From: "Uwe Kleine-König" <>
To: Thomas Gummerer <>
	Johannes Schindelin <>,
Subject: Re: [PATCH v2] range-diff: don't segfault with mode-only changes
Date: Wed, 9 Oct 2019 09:42:00 +0200
Message-ID: <> (raw)
In-Reply-To: <20191008173843.GC74671@cat>

On Tue, Oct 08, 2019 at 06:38:43PM +0100, Thomas Gummerer wrote:
> In ef283b3699 ("apply: make parse_git_diff_header public", 2019-07-11)
> the 'parse_git_diff_header' function was made public and useable by
> callers outside of apply.c.
> However it was missed that its (then) only caller, 'find_header' did
> some error handling, and completing 'struct patch' appropriately.
> range-diff then started using this function, and tried to handle this
> appropriately itself, but fell short in some cases.  This in turn
> would lead to range-diff segfaulting when there are mode-only changes
> in a range.
> Move the error handling and completing of the struct into the
> 'parse_git_diff_header' function, so other callers can take advantage
> of it.  This fixes the segfault in 'git range-diff'.
> Reported-by: Uwe Kleine-König <>
> Signed-off-by: Thomas Gummerer <>

This patch also makes git work again for the originally problematic

Tested-by: Uwe Kleine-König <>

Thanks for your quick reaction to my bug report,
Uwe Kleine-König

Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 |  |

      parent reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07 11:06 Regression in v2.23 Uwe Kleine-König
2019-10-07 13:48 ` Thomas Gummerer
2019-10-08  3:11   ` Junio C Hamano
2019-10-08  7:43     ` Johannes Schindelin
2019-10-08  6:24   ` Uwe Kleine-König
2019-10-08  7:44   ` Johannes Schindelin
2019-10-08  7:49     ` Johannes Schindelin
2019-10-08 17:38   ` [PATCH v2] range-diff: don't segfault with mode-only changes Thomas Gummerer
2019-10-08 19:44     ` Johannes Schindelin
2019-10-09  7:42     ` Uwe Kleine-König [this message]

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:

  List information:

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

  git send-email \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Example config snippet for mirrors

Newsgroups are available over NNTP:

 note: .onion URLs require Tor:

AGPL code for this site: git clone