Commit a6ee240a22bfd91ad970ed354f494e38d9d4280b

Stefan Sperling 2020-03-18T16:11:32

improve error message on short packfile

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/libexec/got-fetch-pack/got-fetch-pack.c b/libexec/got-fetch-pack/got-fetch-pack.c
index e2d60c1..17c6151 100644
--- a/libexec/got-fetch-pack/got-fetch-pack.c
+++ b/libexec/got-fetch-pack/got-fetch-pack.c
@@ -224,7 +224,7 @@ check_pack_hash(int fd, size_t sz, uint8_t *hcomp)
 	ssize_t n, r, nr;
 
 	if (sz < sizeof(struct got_packfile_hdr) + SHA1_DIGEST_LENGTH)
-		return got_error(GOT_ERR_BAD_PACKFILE);
+		return got_error_msg(GOT_ERR_BAD_PACKFILE, "short packfile");
 
 	n = 0;
 	SHA1Init(&ctx);