Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Returndatacopy throws when offset+size is bigger than the size of returndata buffer #4124

Merged
merged 4 commits into from
Jun 12, 2017

Conversation

pirapira
Copy link
Member

@pirapira pirapira commented Jun 8, 2017

This follows the change in the EIP.

libevm/VM.cpp Outdated
@@ -763,6 +763,9 @@ void VM::interpretCases()
{
if (!m_schedule->haveReturnData)
throwBadInstruction();
bigint const endOfAccess{bigint(m_SP[1]) + bigint(m_SP[2])};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid explicit constructor here to still pretend bigint works like regular int.

bigint const endOfAccess = bigint(m_SP[1]) + bigint(m_SP[2]);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me pretend that way.

@codecov-io
Copy link

Codecov Report

Merging #4124 into develop will decrease coverage by <.01%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           develop    #4124      +/-   ##
===========================================
- Coverage     65.7%   65.69%   -0.01%     
===========================================
  Files          303      303              
  Lines        22999    23008       +9     
===========================================
+ Hits         15112    15116       +4     
- Misses        7887     7892       +5
Impacted Files Coverage Δ
libevm/VM.h 76.92% <ø> (ø) ⬆️
libevm/VMFace.h 85.71% <100%> (-6.6%) ⬇️
libevm/VM.cpp 94.76% <100%> (+2.98%) ⬆️
libevm/VMCalls.cpp 100% <100%> (ø) ⬆️
test/tools/jsontests/StateTests.cpp 95.5% <100%> (+0.05%) ⬆️
test/tools/fuzzTesting/fuzzHelper.cpp 26.47% <0%> (-8.34%) ⬇️
libethashseal/EthashCPUMiner.cpp 88.23% <0%> (-2.95%) ⬇️

@pirapira
Copy link
Member Author

pirapira commented Jun 9, 2017

@gumb0 @chriseth @chfast ready to merge?

@chfast
Copy link
Member

chfast commented Jun 9, 2017

Yes.

@pirapira pirapira merged commit bbc1074 into develop Jun 12, 2017
@pirapira pirapira deleted the returndatacopy_throw branch June 12, 2017 08:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants