core/vm: copy container

This commit is contained in:
Marius van der Wijden 2025-02-13 16:37:36 +01:00
parent 0e4c4c21af
commit 1bb727ba75
1 changed files with 7 additions and 2 deletions

View File

@ -196,8 +196,13 @@ func opReturnContract(pc *uint64, interpreter *EVMInterpreter, scope *ScopeConte
return nil, err
}
// append the auxdata
c.rawContainer = append(c.rawContainer, ret...)
if size.Uint64() > 0 {
// copy the container, so we don't rug parents referencing this data
oldContainer := c.rawContainer
c.rawContainer = make([]byte, 0, len(oldContainer)+len(ret))
c.rawContainer = append(c.rawContainer, oldContainer...)
c.rawContainer = append(c.rawContainer, ret...)
}
newDataSize := c.dataLen()
if newDataSize < c.dataSize {
return nil, errors.New("incomplete aux data")