Re: [PATCH v3 1/1] midx.c: fix an integer overflow
Jeff King <peff@peff.net> writes:
> I'd be OK with just this, but adding a binary t/t5319/zero-objs.midx
> would be fine by me, too.
Yup, that sounds like a simple way to make sure we won't regress.
Show 19 quoted lines
> One minor style nit:
>
>> @@ -1124,6 +1130,13 @@ int verify_midx_file(struct repository *r, const char *object_dir, unsigned flag
>> i, oid_fanout1, oid_fanout2, i + 1);
>> }
>>
>> + if (m->num_objects == 0) {
>> + midx_report(_("the midx contains no oid"));
>> + // remaining tests assume that we have objects, so we can
>> + // return here
>> + return verify_midx_error;
>> + }
>
> We prefer /**/ for comments, like:
>
> /*
> * Remaining tests assume that we have objects, so we can
> * return here.
> */