]> git.proxmox.com Git - libgit2.git/commitdiff
Revert "Handle packed peeled objects without trailing newlines"
authorScott J. Goldman <scottjg@github.com>
Tue, 22 Jan 2013 22:08:50 +0000 (14:08 -0800)
committerScott J. Goldman <scottjg@github.com>
Tue, 22 Jan 2013 22:08:50 +0000 (14:08 -0800)
This reverts commit 28b1cdf3a1bdcd37cf9d550c92b8c19b1782ea6b.

//cc #1262 #1267

src/refs.c

index 4ecc628eef6eb9bcbee05920686b8503cc877296..4934a0309eca11de457290eb2e800c280510940f 100644 (file)
@@ -328,7 +328,7 @@ static int packed_parse_peel(
        if (git__prefixcmp(tag_ref->name, GIT_REFS_TAGS_DIR) != 0)
                goto corrupt;
 
-       if (buffer + GIT_OID_HEXSZ > buffer_end)
+       if (buffer + GIT_OID_HEXSZ >= buffer_end)
                goto corrupt;
 
        /* Is this a valid object id? */
@@ -339,13 +339,10 @@ static int packed_parse_peel(
        if (*buffer == '\r')
                buffer++;
 
-       if (*buffer == '\n')
-               buffer++;
-
-       if (buffer != buffer_end)
+       if (*buffer != '\n')
                goto corrupt;
 
-       *buffer_out = buffer;
+       *buffer_out = buffer + 1;
        return 0;
 
 corrupt: