Commit f4a2ff2d5ad89a6875828e130932e110d45ba9d6

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

fix out-of-bounds access in 'gotadmin pack'; wrong array pointer in read_meta()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/pack_create.c b/lib/pack_create.c
index b850ce5..5613eb6 100644
--- a/lib/pack_create.c
+++ b/lib/pack_create.c
@@ -863,7 +863,7 @@ read_meta(struct got_pack_meta ***meta, int *nmeta,
 	}
 
 	for (i = 0; i < ntheirs; i++) {
-		struct got_object_id *id = ours[i];
+		struct got_object_id *id = theirs[i];
 		if (id == NULL)
 			continue;
 		err = got_object_get_type(&obj_type, repo, id);