Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Commit 6bd7db9

Browse files
authored
v2.5.7 stable (#11006)
* [trace] check mem diff within range (#11002) * Update version (v2.5.7-stable)
1 parent ff398fe commit 6bd7db9

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description = "Parity Ethereum client"
33
name = "parity-ethereum"
44
# NOTE Make sure to update util/version/Cargo.toml as well
5-
version = "2.5.6"
5+
version = "2.5.7"
66
license = "GPL-3.0"
77
authors = ["Parity Technologies <admin@parity.io>"]
88

ethcore/src/trace/executive_tracer.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
1919
use ethereum_types::{U256, Address};
2020
use vm::{Error as VmError, ActionParams};
21+
use log::{debug, warn};
2122
use trace::trace::{Call, Create, Action, Res, CreateResult, CallResult, VMTrace, VMOperation, VMExecutedOperation, MemoryDiff, StorageDiff, Suicide, Reward, RewardType};
2223
use trace::{Tracer, VMTracer, FlatTrace};
2324

@@ -245,7 +246,19 @@ impl VMTracer for ExecutiveVMTracer {
245246
}
246247

247248
fn trace_executed(&mut self, gas_used: U256, stack_push: &[U256], mem: &[u8]) {
248-
let mem_diff = self.last_mem_written.take().map(|(o, s)| (o, &(mem[o..o+s])));
249+
let mem_diff = self.last_mem_written.take().map(|(o, s)| {
250+
if o + s > mem.len() {
251+
warn!(
252+
target: "trace",
253+
"Last mem written is out of bounds {} (mem is {})",
254+
o + s,
255+
mem.len(),
256+
);
257+
(o, &[][..])
258+
} else {
259+
(o, &(mem[o..o+s]))
260+
}
261+
});
249262
let store_diff = self.last_store_written.take();
250263
Self::with_trace_in_depth(&mut self.data, self.depth, move |trace| {
251264
let ex = VMExecutedOperation {

util/version/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[package]
44
name = "parity-version"
55
# NOTE: this value is used for Parity Ethereum version string (via env CARGO_PKG_VERSION)
6-
version = "2.5.6"
6+
version = "2.5.7"
77
authors = ["Parity Technologies <admin@parity.io>"]
88
build = "build.rs"
99

0 commit comments

Comments
 (0)