Avoid heap out-of-bounds read in Node::CalcOps (test case: OP_0 OP_2 OP_EQUAL) and assertion failure in ComputeType (test case: OP_0 OP_0 OP_EQUAL)#57
Merged
sipa merged 2 commits intosipa:masterfrom Aug 19, 2021
Conversation
darosior
reviewed
Jul 23, 2021
bitcoin/script/miniscript.h
Outdated
| next_sats.push_back(sats[sats.size() - 1] + sub->ops.sat); | ||
| sats = std::move(next_sats); | ||
| } | ||
| assert(k < sats.size()); |
Contributor
There was a problem hiding this comment.
In c303afd, all the assertions should be k <= sats.size() instead of k < sats.size() as it's now possible and that's what you are checking for in the previous commit.
Contributor
Author
There was a problem hiding this comment.
Indeed. I should have been more careful here!
Contributor
There was a problem hiding this comment.
And i should have had tests to my PR updating the thresh bounds :) #59 fixes this.
c303afd to
bc1f2c7
Compare
darosior
approved these changes
Aug 1, 2021
Contributor
darosior
left a comment
There was a problem hiding this comment.
ACK bc1f2c7 modulo the silent int64 -> unsigned cast.
Here is a test exercising the two fixes: darosior@24a9e0b
…OP_EQUAL) and assertion failure in ComputeType (test case: OP_0 OP_0 OP_EQUAL) Closes sipa#12. Closes sipa#13. Co-authored-by: sanket1729 <[email protected]>
…unds read in case of k > sats.size() Co-authored-by: practicalswift <[email protected]>
bc1f2c7 to
a47dcc6
Compare
darosior
approved these changes
Aug 5, 2021
Owner
|
utACK a47dcc6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #12.
Closes #13.
Supercedes #18