mirror of
https://github.com/go-delve/delve.git
synced 2025-11-01 20:20:40 +08:00
proc: Possible panic while reading uninitialised memory
If uninitialized memory is read loadArrayValues could try to call cacheMemory with a negative size, which could cause a 'makeslice: len out of range' panic. Fixes #354 (partial)
This commit is contained in:
@ -35,6 +35,9 @@ func cacheMemory(mem memoryReadWriter, addr uintptr, size int) memoryReadWriter
|
||||
if !cacheEnabled {
|
||||
return mem
|
||||
}
|
||||
if size <= 0 {
|
||||
return mem
|
||||
}
|
||||
if cacheMem, isCache := mem.(*memCache); isCache {
|
||||
if cacheMem.contains(addr, size) {
|
||||
return mem
|
||||
|
||||
Reference in New Issue
Block a user