From c41e20b30b2bd4b8167917336676cde6f6aadd06 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Tue, 5 Sep 2006 20:00:17 +0100 Subject: send-pack: remove remote reference limit When build a pack for a push we query the remote copy for existant heads. These are used to prune unnecessary objects from the pack. As we receive the remote references in get_remote_heads() we validate the reference names via check_ref() which includes a length check; rejecting those >45 characters in size. This is a miss converted change, it was originally designed to reject messages which were less than 45 characters in length (a 40 character sha1 and refs/) to prevent comparing unitialised memory. check_ref() now gets the raw length so check for at least 5 characters. Signed-off-by: Andy Whitcroft Signed-off-by: Junio C Hamano --- connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'connect.c') diff --git a/connect.c b/connect.c index 06ef387649..1c6429bd51 100644 --- a/connect.c +++ b/connect.c @@ -17,7 +17,7 @@ static int check_ref(const char *name, int len, unsigned int flags) if (!flags) return 1; - if (len > 45 || memcmp(name, "refs/", 5)) + if (len < 5 || memcmp(name, "refs/", 5)) return 0; /* Skip the "refs/" part */ -- cgit v1.2.3