summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorLibravatar Thomas Gummerer <t.gummerer@gmail.com>2019-10-08 18:38:43 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-10-09 10:41:11 +0900
commit2b6a9b13ca4a687aeb0cad5f32e49711b3e67aaa (patch)
treebf3c67db6ca8048ab24be48ffaa4adf3868d566c /.github
parentrange-diff: add headers to the outer hunk header (diff)
downloadtgif-2b6a9b13ca4a687aeb0cad5f32e49711b3e67aaa.tar.xz
range-diff: don't segfault with mode-only changes
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 <u.kleine-koenig@pengutronix.de> Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '.github')
0 files changed, 0 insertions, 0 deletions