diff options
author | fanquake <fanquake@gmail.com> | 2020-01-29 19:26:17 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2020-01-29 19:39:50 +0800 |
commit | 1326092e6cef8c58353c1d6438870c9a35266fd1 (patch) | |
tree | dd79d6792a779b24cb14abff903c248dc77a609d /src/test | |
parent | fe48ac8580ae7ddf38575f958dcf9d6ea316e90d (diff) | |
parent | deaa6dd144f5650b385658a0c4f9a014aff8dde2 (diff) |
Merge #17156: psbt: check that various indexes and amounts are within bounds
deaa6dd144f5650b385658a0c4f9a014aff8dde2 psbt: check output index is within bounds before accessing (Andrew Chow)
f1ef7f0aa46338f4cd8de79696027a1bf868f359 Don't calculate tx fees for PSBTs with invalid money values (Andrew Chow)
Pull request description:
Fixes #17149
Two classes of issues were found by the psbt fuzzer: values out of range and causing overflows, and prevout indexes being out of range. This PR fixes both.
When accessing a specific output using the index given in the tx, check that it is actually a possible output before trying to access the output.
When summing and checking amounts for `decodepsbt` and `analyzepsbt`, make sure that the values are actually valid money values.. Otherwise, stop summing and don't show the fee. For `analyzepsbt`, return that the next role is the Creator since the Creator needs to remake the transaction to be valid.
ACKs for top commit:
practicalswift:
ACK deaa6dd144f5650b385658a0c4f9a014aff8dde2 -- only change since last ACK was the addition of tests
gwillen:
tested ACK deaa6dd, would also like to see this merged!
Tree-SHA512: 06c36720bbb5a7ab1c29f7d15878bf9f0d3e5760c06bff479d412e1bf07bb3e0e9ab6cca820a4bfedaab71bfd7af813807e87cbcdf0af25cc3f66a53a06dbcfd
Diffstat (limited to 'src/test')
0 files changed, 0 insertions, 0 deletions