diff options
author | Samuel Dobson <dobsonsa68@gmail.com> | 2021-10-12 15:19:00 +1300 |
---|---|---|
committer | Samuel Dobson <dobsonsa68@gmail.com> | 2021-10-12 15:32:11 +1300 |
commit | fbbbc594ad2f57969cd49d116f68547856d51359 (patch) | |
tree | 42b2efeb40631dabc69225d170ca2fb31f50a87f /test | |
parent | e418a8e675e4dbca9f9c3cf7dd4633aa3c6c196e (diff) | |
parent | fa43e7c2d9dc5e2df70acd2019bdd24023c1d333 (diff) | |
download | bitcoin-fbbbc594ad2f57969cd49d116f68547856d51359.tar.xz |
Merge bitcoin/bitcoin#23227: bitcoin-tx: Avoid treating integer overflow as OP_0
fa43e7c2d9dc5e2df70acd2019bdd24023c1d333 bitcoin-tx: Avoid treating overflow as OP_0 (MarcoFalke)
fa053c0019bc8b2174c485f4885f894f2b5de472 style: Fix whitespace in Parse* functions (MarcoFalke)
fa03dec7e98bdda8aa596ef7943cf0a8d0bcb127 refactor: Use C++11 range based for loop in ParseScript (MarcoFalke)
fad55e79ca18a5894a8da6db6309c323eecbb178 doc: Fixup ToIntegral docs (MarcoFalke)
Pull request description:
Seems odd to treat integer overflow as `OP_0`, so fix that.
ACKs for top commit:
theStack:
re-ACK fa43e7c2d9dc5e2df70acd2019bdd24023c1d333
shaavan:
ACK fa43e7c2d9dc5e2df70acd2019bdd24023c1d333
Tree-SHA512: 1bbe2de62d853badc18d57d169c6e78ddcdff037e5a85357995dead11c8e67a4fe35087e08a181c60753f8ce91058b7fcc06f5b7901afedc78fbacea8bc3ef4f
Diffstat (limited to 'test')
-rwxr-xr-x | test/lint/lint-locale-dependence.sh | 2 | ||||
-rw-r--r-- | test/util/data/bitcoin-util-test.json | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/test/lint/lint-locale-dependence.sh b/test/lint/lint-locale-dependence.sh index 712c4f0d5b..f82d82f890 100755 --- a/test/lint/lint-locale-dependence.sh +++ b/test/lint/lint-locale-dependence.sh @@ -38,7 +38,7 @@ export LC_ALL=C # https://stackoverflow.com/a/34878283 for more details. # TODO: Reduce KNOWN_VIOLATIONS by replacing uses of locale dependent stoul/strtol with locale -# independent ToIntegral<T>(...). +# independent ToIntegral<T>(...) or the ParseInt*() functions. # TODO: Reduce KNOWN_VIOLATIONS by replacing uses of locale dependent snprintf with strprintf. KNOWN_VIOLATIONS=( "src/bitcoin-tx.cpp.*stoul" diff --git a/test/util/data/bitcoin-util-test.json b/test/util/data/bitcoin-util-test.json index a648c0287a..20684f0f76 100644 --- a/test/util/data/bitcoin-util-test.json +++ b/test/util/data/bitcoin-util-test.json @@ -295,6 +295,12 @@ "description": "Create a new transaction with a single output script (OP_DROP) in a P2SH, wrapped in a P2SH (output as json)" }, { "exec": "./bitcoin-tx", + "args": ["-create", "outscript=0:999999999999999999999999999999"], + "return_code": 1, + "error_txt": "error: script parse error: decimal numeric value only allowed in the range -0xFFFFFFFF...0xFFFFFFFF", + "description": "Try to parse an output script with a decimal number above the allowed range" + }, + { "exec": "./bitcoin-tx", "args": ["-create", "outscript=0:9999999999"], "return_code": 1, "error_txt": "error: script parse error: decimal numeric value only allowed in the range -0xFFFFFFFF...0xFFFFFFFF", |