Re: [PATCH v3 2/3] commit-graph: fix buffer read-overflow

2018-12-11 Thread Jeff King
On Mon, Dec 10, 2018 at 01:56:49PM -0800, Josh Steadmon wrote: > > "stat(1)" is not so portable, so you'll get complaints from minority > > platform users later. So is "truncate(1)". > > Ack, thanks for the catch. I have a workaround for stat in the form of > "wc -c", and for truncate with a com

Re: [PATCH v3 2/3] commit-graph: fix buffer read-overflow

2018-12-10 Thread Josh Steadmon
On 2018.12.10 05:28, SZEDER Gábor wrote: > On Sun, Dec 09, 2018 at 01:01:29PM +0900, Junio C Hamano wrote: > > Josh Steadmon writes: > > > > > diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh > > > index 5fe21db99f..5b6b44b78e 100755 > > > --- a/t/t5318-commit-graph.sh > > > +++ b/t

Re: [PATCH v3 2/3] commit-graph: fix buffer read-overflow

2018-12-10 Thread Josh Steadmon
On 2018.12.09 13:01, Junio C Hamano wrote: > Josh Steadmon writes: > > > diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh > > index 5fe21db99f..5b6b44b78e 100755 > > --- a/t/t5318-commit-graph.sh > > +++ b/t/t5318-commit-graph.sh > > @@ -366,24 +366,30 @@ > > GRAPH_OCTOPUS_DATA_OFF

Re: [PATCH v3 2/3] commit-graph: fix buffer read-overflow

2018-12-09 Thread SZEDER Gábor
On Sun, Dec 09, 2018 at 01:01:29PM +0900, Junio C Hamano wrote: > Josh Steadmon writes: > > > diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh > > index 5fe21db99f..5b6b44b78e 100755 > > --- a/t/t5318-commit-graph.sh > > +++ b/t/t5318-commit-graph.sh > > @@ -366,24 +366,30 @@ > > G

Re: [PATCH v3 2/3] commit-graph: fix buffer read-overflow

2018-12-08 Thread Junio C Hamano
Josh Steadmon writes: > diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh > index 5fe21db99f..5b6b44b78e 100755 > --- a/t/t5318-commit-graph.sh > +++ b/t/t5318-commit-graph.sh > @@ -366,24 +366,30 @@ GRAPH_OCTOPUS_DATA_OFFSET=$(($GRAPH_COMMIT_DATA_OFFSET > + \ > GRAPH_BYTE_OCTOPUS=

[PATCH v3 2/3] commit-graph: fix buffer read-overflow

2018-12-07 Thread Josh Steadmon
fuzz-commit-graph identified a case where Git will read past the end of a buffer containing a commit graph if the graph's header has an incorrect chunk count. A simple bounds check in parse_commit_graph() prevents this. Signed-off-by: Josh Steadmon --- commit-graph.c | 14 --