Re: [PATCH 4/4] Fix delta offset overflow

2017-08-11 Thread Junio C Hamano
Martin Koegler writes: > On Thu, Aug 10, 2017 at 01:49:24PM -0700, Junio C Hamano wrote: >> The lower 4-byte of moff (before incrementing it with msize) were >> already encoded to the output stream before this hunk. Shouldn't >> we be checking if moff would fit in uint32_t _before_ that happens?

Re: [PATCH 4/4] Fix delta offset overflow

2017-08-10 Thread Martin Koegler
On Thu, Aug 10, 2017 at 01:49:24PM -0700, Junio C Hamano wrote: > The lower 4-byte of moff (before incrementing it with msize) were > already encoded to the output stream before this hunk. Shouldn't > we be checking if moff would fit in uint32_t _before_ that happens? moff is otherwise only decre

Re: [PATCH 4/4] Fix delta offset overflow

2017-08-10 Thread Junio C Hamano
Martin Koegler writes: > From: Martin Koegler > > Prevent generating delta offsets beyond 4G. > > Signed-off-by: Martin Koegler > --- > diff-delta.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/diff-delta.c b/diff-delta.c > index 3d5e1ef..633883e 100644 > --- a/diff-delta.c > ++

[PATCH 4/4] Fix delta offset overflow

2017-08-10 Thread Martin Koegler
From: Martin Koegler Prevent generating delta offsets beyond 4G. Signed-off-by: Martin Koegler --- diff-delta.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/diff-delta.c b/diff-delta.c index 3d5e1ef..633883e 100644 --- a/diff-delta.c +++ b/diff-delta.c @@ -454,6 +454,9 @@ create_delt