mirror of
https://git.proxmox.com/git/libgit2
synced 2026-01-05 21:36:11 +00:00
Bugfix: Return NULL in push_leaf, when trie is full
os->full was set 1, but the overflowed idx_leaf was still used to index into os->nodes a little later. Returning NULL fixes that.
This commit is contained in:
parent
6828bf26e9
commit
52f537e9c5
@ -269,8 +269,10 @@ static trie_node *push_leaf(git_oid_shorten *os, node_index idx, int push_at, co
|
||||
|
||||
idx_leaf = (node_index)os->node_count++;
|
||||
|
||||
if (os->node_count == SHRT_MAX)
|
||||
if (os->node_count == SHRT_MAX) {
|
||||
os->full = 1;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
node = &os->nodes[idx];
|
||||
node->children[push_at] = -idx_leaf;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user