fix panic in parity-evm json tracer (#6338)

This commit is contained in:
cdetrio 2017-08-20 00:03:47 -04:00 committed by Gav Wood
parent 9e4c122cf3
commit 4ccc82be92

View File

@ -116,6 +116,9 @@ impl trace::VMTracer for Informant {
self.stack.extend_from_slice(stack_push); self.stack.extend_from_slice(stack_push);
if let Some((pos, data)) = mem_diff { if let Some((pos, data)) = mem_diff {
if self.memory.len() < (pos + data.len()) {
self.memory.resize(pos + data.len(), 0);
}
self.memory[pos..pos + data.len()].copy_from_slice(data); self.memory[pos..pos + data.len()].copy_from_slice(data);
} }