]> git.ipfire.org Git - pakfire.git/commitdiff
filelist: Fix off-by-one error on cleanup
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 19 Sep 2022 20:14:20 +0000 (20:14 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 19 Sep 2022 20:14:20 +0000 (20:14 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/filelist.c

index aa34f4d73d124b2d1d1da3038847296180c7a700..c894ad3ef0dd8cd366a6d48c4537f03c79b49a9b 100644 (file)
@@ -477,7 +477,7 @@ int pakfire_filelist_cleanup(struct pakfire_filelist* list) {
        int r;
 
        // Walk through the list backwards
-       for (unsigned int i = list->size; i > 0; i--) {
+       for (unsigned int i = list->size - 1; i > 0; i--) {
                r = pakfire_file_cleanup(list->elements[i]);
                if (r)
                        return r;