Revert implementation changes

This commit is contained in:
Joshua Peek 2012-08-09 14:47:29 -05:00
parent 28e0068172
commit 186c054d65

View File

@ -173,13 +173,20 @@ static int loose_parse_oid(git_oid *oid, git_buf *file_content)
buffer = (char *)file_content->ptr;
/* File format: 40 chars (OID) */
if (git_buf_len(file_content) < GIT_OID_HEXSZ)
/* File format: 40 chars (OID) + newline */
if (git_buf_len(file_content) < GIT_OID_HEXSZ + 1)
goto corrupt;
if (git_oid_fromstr(oid, buffer) < 0)
goto corrupt;
buffer = buffer + GIT_OID_HEXSZ;
if (*buffer == '\r')
buffer++;
if (*buffer != '\n')
goto corrupt;
return 0;
corrupt: