Re: [PATCH 2/2] apply: handle assertion failure gracefully

2017-06-27 Thread Junio C Hamano
René Scharfe writes: > Hmm, pondering that, it seems I forgot to reset its value after each > patch. Or better just move it into struct patch, next to the extension > bits: Good catch. > -- >8 -- > Subject: fixup! apply: check git diffs for mutually exclusive header lines > ---

Re: [PATCH 2/2] apply: handle assertion failure gracefully

2017-06-27 Thread René Scharfe
Am 27.06.2017 um 20:08 schrieb Junio C Hamano: > René Scharfe writes: > >> Thought a bit more about it, and as a result here's a simpler approach: >> >> -- >8 -- >> Subject: [PATCH] apply: check git diffs for mutually exclusive header lines >> >> A file can either be added,

Re: [PATCH 2/2] apply: handle assertion failure gracefully

2017-06-27 Thread Junio C Hamano
René Scharfe writes: > Thought a bit more about it, and as a result here's a simpler approach: > > -- >8 -- > Subject: [PATCH] apply: check git diffs for mutually exclusive header lines > > A file can either be added, removed, copied, or renamed, but no two of > these actions can

Re: [PATCH 2/2] apply: handle assertion failure gracefully

2017-06-27 Thread René Scharfe
Am 25.02.2017 um 11:13 schrieb Vegard Nossum: > For the patches in the added testcases, we were crashing with: > > git-apply: apply.c:3665: check_preimage: Assertion `patch->is_new <= 0' > failed. > diff --git a/t/t4154-apply-git-header.sh b/t/t4154-apply-git-header.sh > index

Re: [PATCH 2/2] apply: handle assertion failure gracefully

2017-06-27 Thread René Scharfe
Am 28.02.2017 um 11:50 schrieb René Scharfe: > Am 27.02.2017 um 23:33 schrieb Junio C Hamano: >> René Scharfe writes: >> >>> Am 27.02.2017 um 21:04 schrieb Junio C Hamano: René Scharfe writes: >> diff --git a/apply.c b/apply.c >> index

Re: [PATCH 2/2] apply: handle assertion failure gracefully

2017-02-28 Thread René Scharfe
Am 27.02.2017 um 23:33 schrieb Junio C Hamano: > René Scharfe writes: > >> Am 27.02.2017 um 21:04 schrieb Junio C Hamano: >>> René Scharfe writes: >>> > diff --git a/apply.c b/apply.c > index cbf7cc7f2..9219d2737 100644 > --- a/apply.c > +++ b/apply.c

Re: [PATCH 2/2] apply: handle assertion failure gracefully

2017-02-27 Thread Junio C Hamano
René Scharfe writes: > Am 27.02.2017 um 21:04 schrieb Junio C Hamano: >> René Scharfe writes: >> diff --git a/apply.c b/apply.c index cbf7cc7f2..9219d2737 100644 --- a/apply.c +++ b/apply.c @@ -3652,7 +3652,6 @@ static int

Re: [PATCH 2/2] apply: handle assertion failure gracefully

2017-02-27 Thread René Scharfe
Am 27.02.2017 um 21:04 schrieb Junio C Hamano: René Scharfe writes: diff --git a/apply.c b/apply.c index cbf7cc7f2..9219d2737 100644 --- a/apply.c +++ b/apply.c @@ -3652,7 +3652,6 @@ static int check_preimage(struct apply_state *state, if (!old_name)

Re: [PATCH 2/2] apply: handle assertion failure gracefully

2017-02-27 Thread Junio C Hamano
René Scharfe writes: >> diff --git a/apply.c b/apply.c >> index cbf7cc7f2..9219d2737 100644 >> --- a/apply.c >> +++ b/apply.c >> @@ -3652,7 +3652,6 @@ static int check_preimage(struct apply_state *state, >> if (!old_name) >> return 0; >> >> -

Re: [PATCH 2/2] apply: handle assertion failure gracefully

2017-02-25 Thread René Scharfe
Am 25.02.2017 um 11:13 schrieb Vegard Nossum: For the patches in the added testcases, we were crashing with: git-apply: apply.c:3665: check_preimage: Assertion `patch->is_new <= 0' failed. As it turns out, check_preimage() is prepared to handle these conditions, so we can remove the

[PATCH 2/2] apply: handle assertion failure gracefully

2017-02-25 Thread Vegard Nossum
For the patches in the added testcases, we were crashing with: git-apply: apply.c:3665: check_preimage: Assertion `patch->is_new <= 0' failed. As it turns out, check_preimage() is prepared to handle these conditions, so we can remove the assertion. Found using AFL. Signed-off-by: Vegard