提交 6c7ad405 编写于 作者: A aarzilli

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)
上级 d756eba1
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册