Iterating over a size_t with unsigned could lead to an endless loop
while adding uid/gid to a list which already counts 4 billion
entries.
I doubt that this can ever happen, given that the routines become
very slow with insertions, but better be safe than sorry.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
static int
add_owner_id(struct archive_match *a, struct id_array *ids, int64_t id)
{
- unsigned i;
+ size_t i;
if (ids->count + 1 >= ids->size) {
void *p;
static int
match_owner_id(struct id_array *ids, int64_t id)
{
- unsigned b, m, t;
+ size_t b, m, t;
t = 0;
- b = (unsigned)ids->count;
+ b = ids->count;
while (t < b) {
m = (t + b)>>1;
if (ids->ids[m] == id)