Johannes Schindelin writes:
> So far, we assumed that the buffer is NUL terminated, but this is not
> a safe assumption, now that we opened the fsck_object() API to pass a
> buffer directly.
>
> So let's make sure that there is at least an empty line in the buffer.
> That way, our checks would fa
On Wed, Sep 10, 2014 at 9:52 AM, Johannes Schindelin
wrote:
> So far, we assumed that the buffer is NUL terminated, but this is not
> a safe assumption, now that we opened the fsck_object() API to pass a
> buffer directly.
>
> So let's make sure that there is at least an empty line in the buffer.
Hi Junio,
On Wed, 10 Sep 2014, Junio C Hamano wrote:
> Johannes Schindelin writes:
>
> > diff --git a/fsck.c b/fsck.c
> > index dd77628..9dd7d12 100644
> > --- a/fsck.c
> > +++ b/fsck.c
> > @@ -237,6 +237,26 @@ static int fsck_tree(struct tree *item, int strict,
> > fsck_error error_func)
> >
Johannes Schindelin writes:
>> > + for (i = 0; i < size; i++) {
>> > + switch (buffer[i]) {
>> > + case '\0':
>> > + return error_func(obj, FSCK_ERROR,
>> > + "invalid message: NUL at offset %d", i);
>>
>> Isn't this "invalid header"?
4 matches
Mail list logo