Fix unsigned integer overflow in tapscript validation weight calculation#24217
Merged
maflcko merged 1 commit intobitcoin:masterfrom Feb 7, 2022
Merged
Fix unsigned integer overflow in tapscript validation weight calculation#24217maflcko merged 1 commit intobitcoin:masterfrom
maflcko merged 1 commit intobitcoin:masterfrom
Conversation
Member
Author
|
On my system, this commit doesn't change the binary for gcc with O2, but it does change it for clang |
Member
Author
|
centos 8 CI failure can be ignored |
theStack
approved these changes
Feb 1, 2022
Contributor
theStack
left a comment
There was a problem hiding this comment.
Code-review ACK fadc54b
For reference, these are the only instances where the constants VALIDATION_WEIGHT_{PER_SIGOP_PASSED,OFFSET} are used:
bitcoin/src/script/interpreter.cpp
Line 386 in 133f73e
bitcoin/src/script/interpreter.cpp
Line 1953 in 133f73e
sidhujag
pushed a commit
to syscoin/syscoin
that referenced
this pull request
Feb 7, 2022
…ation weight calculation fadc54b Fix unsigned integer overflow in tapscript validation weight calculation (MarcoFalke) Pull request description: Change the tapscript validation weight constants from uint64_t to int64_t, since the type of m_validation_weight_left is also int64_t. Otherwise this will cause sanitizer warnings. This should be safe because signed integer overflow isn't expected to happen. ACKs for top commit: PastaPastaPasta: utACK fadc54b theStack: Code-review ACK fadc54b Tree-SHA512: 7a62d3a84733ab7827e3fa50d83f5493f2481b725c587e986eb2c128a769f023756f3ad964401526e386a847aa630a9f6c43a57d25ce5fd4af0b6bb5e0615528
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Change the tapscript validation weight constants from uint64_t to int64_t, since the type of m_validation_weight_left is also int64_t. Otherwise this will cause sanitizer warnings.
This should be safe because signed integer overflow isn't expected to happen.