提交 d581dfee 编写于 作者: F Felix Lange

ethdb: copy stored memdb values

Storing a value in LevelDB copies the bytes, modifying the value
afterwards does not affect the content of the database. This commit
ensures that MemDatabase satisfies the same property.
上级 8b32f10f
......@@ -36,8 +36,7 @@ func NewMemDatabase() (*MemDatabase, error) {
}
func (db *MemDatabase) Put(key []byte, value []byte) error {
db.db[string(key)] = value
db.db[string(key)] = common.CopyBytes(value)
return nil
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册