Commit ae23ce34e8072d9add04d0182d11c532443e70e8

Stefan Sperling 2021-07-01T14:57:10

fix inverted check guarding recallocarray() calls in get_reflist_object_ids()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/repository_admin.c b/lib/repository_admin.c
index 4716cfc..a4af1c4 100644
--- a/lib/repository_admin.c
+++ b/lib/repository_admin.c
@@ -101,7 +101,7 @@ get_reflist_object_ids(struct got_object_id ***ids, int *nobjects,
 			}
 		}
 
-		if (nalloc >= *nobjects) {
+		if (nalloc <= *nobjects) {
 			struct got_object_id **new;
 			new = recallocarray(*ids, nalloc,
 			    nalloc + alloc_chunksz,