Commit de30857e1014d2b499226ec0ecad64870426005f

Stefan Sperling 2019-08-23T16:40:51

fix reading pack index files with large offsets (patch by Hiltjo Posthuma)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/lib/pack.c b/lib/pack.c
index 06a6211..fdf067e 100644
--- a/lib/pack.c
+++ b/lib/pack.c
@@ -262,8 +262,8 @@ got_packidx_init_hdr(struct got_packidx *p, int verify)
 	if (p->map)
 		h->large_offsets = (uint64_t *)((uint8_t*)(p->map + offset));
 	else {
-		h->offsets = malloc(nobj * sizeof(*h->large_offsets));
-		if (h->offsets == NULL) {
+		h->large_offsets = malloc(nobj * sizeof(*h->large_offsets));
+		if (h->large_offsets == NULL) {
 			err = got_error_from_errno("malloc");
 			goto done;
 		}