Commit de060dffe28619a317fa08ba93510e621429e235

Stefan Sperling 2018-12-24T17:39:23

handle zero-length files in open_blob() correctly

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/object.c b/lib/object.c
index 5db2105..daab8a5 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -1023,7 +1023,7 @@ open_blob(struct got_blob_object **blob, struct got_repository *repo,
 		goto done;
 	}
 
-	if (hdrlen >= size) {
+	if (hdrlen > size) {
 		err = got_error(GOT_ERR_BAD_OBJ_HDR);
 		goto done;
 	}