Skip to content

Commit

Permalink
reset memory in memStore when value length < value offset
Browse files Browse the repository at this point in the history
  • Loading branch information
jwasinger authored and axic committed Oct 12, 2017
1 parent 9ffa74c commit fbb445d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/opFns.js
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,11 @@ function memStore (runState, offset, val, valOffset, length, skipSubMem) {
offset = offset.toNumber()
length = length.toNumber()

if (valOffset.gtn(val.length)) {
runState.memory = []
return
}

var safeLen = null
if (valOffset.addn(length).gtn(val.length)) {
if (valOffset.gte(new BN(val.length))) {
Expand Down

0 comments on commit fbb445d

Please sign in to comment.