Commit b0517dd07105250eb20b57d704d7102f6e4ab18d

Stefan Sperling 2018-01-10T21:18:24

fix off-by-one in pack file size check

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/pack.c b/lib/pack.c
index 8267925..f8e642d 100644
--- a/lib/pack.c
+++ b/lib/pack.c
@@ -161,7 +161,7 @@ got_packidx_open(struct got_packidx_v2_hdr **packidx, const char *path)
 	}
 
 	/* Large file offsets are contained only in files > 2GB. */
-	if (packfile_size < 0x80000000)
+	if (packfile_size <= 0x80000000)
 		goto checksum;
 
 	p->large_offsets = calloc(nobj, sizeof(*p->large_offsets));