Skip to content

Commit

Permalink
fix: restrict capacity of the key to prevent possible bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
arturmelanchyk committed Dec 23, 2024
1 parent 36a5603 commit 5a0e3e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion node.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ func (n *node) dereference() {

buf := make([]byte, len(inode.Key())+len(inode.Value()))

key := buf[:len(inode.Key())]
key := buf[:len(inode.Key()):len(inode.Key())]
copy(key, inode.Key())
inode.SetKey(key)
common.Assert(len(inode.Key()) > 0, "dereference: zero-length inode key")
Expand Down

0 comments on commit 5a0e3e1

Please sign in to comment.