mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-12 08:45:01 +00:00
tree-cache: don't error out on a childless invalidated entry
The code used to assume that there had to be data after the newline in a tree cache extension entry. This isn't true for a childless invalidated entry if it's the last one, as there won't be any children nor a hash to take up space. Adapt the off-by-one comparison to also work in this case. Fixes #633.
This commit is contained in:
parent
7dbbf4d7f2
commit
2218fd57a5
@ -130,7 +130,7 @@ static int read_tree_internal(git_tree_cache **out,
|
|||||||
|
|
||||||
tree->children_count = count;
|
tree->children_count = count;
|
||||||
|
|
||||||
if (*buffer != '\n' || ++buffer >= buffer_end) {
|
if (*buffer != '\n' || ++buffer > buffer_end) {
|
||||||
error = GIT_EOBJCORRUPTED;
|
error = GIT_EOBJCORRUPTED;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user