mirror of
https://git.proxmox.com/git/libgit2
synced 2026-01-25 22:09:24 +00:00
Revert implementation changes
This commit is contained in:
parent
28e0068172
commit
186c054d65
11
src/refs.c
11
src/refs.c
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user