mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
cov: validate count is bigger then 0
To avoid teoretical underflow...
This commit is contained in:
parent
466265eaa6
commit
a98709aeae
@ -4416,8 +4416,9 @@ static int _sort_rows(struct dm_report *rh)
|
||||
qsort(rows, count, sizeof(**rows), _row_compare);
|
||||
|
||||
dm_list_init(&rh->rows);
|
||||
while (count--)
|
||||
dm_list_add_h(&rh->rows, &(*rows)[count]->list);
|
||||
|
||||
while (count > 0)
|
||||
dm_list_add_h(&rh->rows, &(*rows)[--count]->list);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -4415,8 +4415,9 @@ static int _sort_rows(struct dm_report *rh)
|
||||
qsort(rows, count, sizeof(**rows), _row_compare);
|
||||
|
||||
dm_list_init(&rh->rows);
|
||||
while (count--)
|
||||
dm_list_add_h(&rh->rows, &(*rows)[count]->list);
|
||||
|
||||
while (count > 0)
|
||||
dm_list_add_h(&rh->rows, &(*rows)[--count]->list);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user