summaryrefslogtreecommitdiff
path: root/src/refs.c
diff options
context:
space:
mode:
authorScott J. Goldman <scottjg@github.com>2013-01-22 14:08:50 -0800
committerScott J. Goldman <scottjg@github.com>2013-01-22 14:08:50 -0800
commit2a707d0e24e206666626ae858e5ba618ffef0547 (patch)
tree297b91809cb49bfca51dbb74bd3658c038742ca9 /src/refs.c
parent148c786cd6d5573bc76cca48bc9f4aa2cb165184 (diff)
downloadlibgit2-2a707d0e24e206666626ae858e5ba618ffef0547.tar.gz
Revert "Handle packed peeled objects without trailing newlines"
This reverts commit 28b1cdf3a1bdcd37cf9d550c92b8c19b1782ea6b. //cc #1262 #1267
Diffstat (limited to 'src/refs.c')
-rw-r--r--src/refs.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/refs.c b/src/refs.c
index 4ecc628ee..4934a0309 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -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: