From: Junio C Hamano Date: Fri, 2 Mar 2007 08:31:51 +0000 (-0800) Subject: Merge branch 'maint' X-Git-Tag: v1.5.1-rc1~109 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/8b969a5fb5e5891d9ad4c236fd9487c4673bfa2a Merge branch 'maint' * maint: Another memory overrun in http-push.c fetch.o depends on the headers, too. Documentation: Correct minor typo in git-add documentation. Documentation/git-send-email.txt: Fix labeled list formatting Documentation/git-quiltimport.txt: Fix labeled list formatting Documentation/build-docdep.perl: Fix dependencies for included asciidoc files --- 8b969a5fb5e5891d9ad4c236fd9487c4673bfa2a diff --cc http-push.c index 68b78b538a,6af9aeceea..cbb02d3bc1 --- a/http-push.c +++ b/http-push.c @@@ -2168,9 -2171,10 +2171,10 @@@ static void fetch_symref(const char *pa return; /* If it's a symref, set the refname; otherwise try for a sha1 */ - if (!strncmp((char *)buffer.buffer, "ref: ", 5)) { + if (!prefixcmp((char *)buffer.buffer, "ref: ")) { *symref = xmalloc(buffer.posn - 5); - strlcpy(*symref, (char *)buffer.buffer + 5, buffer.posn - 5); + memcpy(*symref, (char *)buffer.buffer + 5, buffer.posn - 6); + (*symref)[buffer.posn - 6] = '\0'; } else { get_sha1_hex(buffer.buffer, sha1); }