Re: [PATCH v2 1/1] midx.c: fix an integer overflow
- From
- Damien Robert <damien.olivier.robert@gmail.com>
- Date
- Mar 12, 2020, 18:24 UTC
- Message-ID
- <20200312182446.6zqjtudkptsvr6uh@feanor>
- In-Reply-To
- <20200312173520.2401776-1-damien.olivier.robert+git@gmail.com>
From Damien Robert, Thu 12 Mar 2020 at 18:35:20 (+0100) :
Show 6 quoted lines
> When verifying a midx index with 0 objects, the > m->num_objects - 1 > overflows to 4294967295. > > Fix this both by checking that the midx contains at least one oid, > and also that we don't write any midx when there is no packfiles.
I forgot to add: previously I was wondering about a warning when in 'write' when we only index one pack file, but this could make sense in the case of a 'midx repack'. So I only warn if there is no objects.