mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 11:20:45 +00:00
Update util.go
This commit is contained in:
parent
c12959dc8c
commit
8a5663ce4c
1 changed files with 6 additions and 0 deletions
|
|
@ -69,6 +69,12 @@ func MemoryPtr(m []byte, offset, size int64) []byte {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if offset < 0 || size < 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if offset+size > int64(len(m)) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if len(m) > int(offset) {
|
if len(m) > int(offset) {
|
||||||
return m[offset : offset+size]
|
return m[offset : offset+size]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue