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.tokkee.org/?a=commitdiff_plain;h=8b969a5fb5e5891d9ad4c236fd9487c4673bfa2a;p=git.git 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 68b78b538,6af9aecee..cbb02d3bc --- 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); }