Commit c20695fb9307ffb954bf967bf3a74f4b31ac25a5

Stefan Sperling 2020-03-20T10:11:43

fix off-by-one in writepkt() length parameter passed by fetch_pack()

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 ece8d97..c8ca19d 100644
--- a/libexec/got-fetch-pack/got-fetch-pack.c
+++ b/libexec/got-fetch-pack/got-fetch-pack.c
@@ -561,7 +561,7 @@ fetch_pack(int fd, int packfd, struct got_object_id *packid,
 			err = got_error(GOT_ERR_NO_SPACE);
 			goto done;
 		}
-		err = writepkt(fd, buf, n + 1);
+		err = writepkt(fd, buf, n);
 		if (err)
 			goto done;
 		nhave++;