summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2008-06-14 12:02:22 +0200
committerJunio C Hamano <gitster@pobox.com>2008-06-14 12:53:09 -0700
commit7c1a9e7901a0e75eab8c7fb34d17c09652d47f7f (patch)
tree0891898e4fc704e451d4e3c8ac075d48575b6117
parent66115d363a93b9e7c9b937773c0c30f81b766d45 (diff)
downloadgit-7c1a9e7901a0e75eab8c7fb34d17c09652d47f7f.tar.gz
Don't allocate too much memory in quote_ref_url
In c13b263, http_fetch_ref got "refs/" included in the ref passed to it, which, incidentally, makes the allocation in quote_ref_url too big, now. Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--http.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/http.c b/http.c
index 2a21ccbb76..105dc93843 100644
--- a/http.c
+++ b/http.c
@@ -583,7 +583,7 @@ static char *quote_ref_url(const char *base, const char *ref)
int len, baselen, ch;
baselen = strlen(base);
- len = baselen + 7; /* "/refs/" + NUL */
+ len = baselen + 2; /* '/' after base and terminating NUL */
for (cp = ref; (ch = *cp) != 0; cp++, len++)
if (needs_quote(ch))
len += 2; /* extra two hex plus replacement % */