The number of arguments is not checked in MutateTxAddOutAddr(..), meaning that
./bitcoin-tx -create outaddr=
accessed the vStrInputParts vector beyond its bounds.
The number of arguments is not checked in MutateTxAddOutAddr(..), meaning that
./bitcoin-tx -create outaddr=
accessed the vStrInputParts vector beyond its bounds.
The number of arguments is not checked MutateTxAddOutAddr(..), meaning
that
> ./bitcoin-tx -create outaddr=
accessed the vStrInputParts vector beyond its bounds.
Ugh. Needs backport to 0.14.1
I've reviewed https://github.com/bitcoin/bitcoin/commit/61a153443ef87d0cf187d2203f0d5ef88e52e7ed and I think MutateTxAddOutAddr() and MutateTxAddOutPubKey() are the only functions that aren't properly checking their inputs. Extra eyes to review are always good though.
The check in MutateTxAddOutPubKey() should be:
if (vStrInputParts.size() < 2 || vStrInputParts.size() > 3)
throw std::runtime_error("TX output missing or too many separators");
since MutateTxAddOutPubKey() can have an optional flag.
I'm currently writing test cases for bitcoin-tx that test this and other errors. We should include that in this PR when it's ready.
Extra testcases are here: https://github.com/jnewbery/bitcoin/commits/bitcoin_tx_input_sanitiser
Yes, it seems MutateTxAddOutAddr and MutateTxAddOutPubKey are the only ones with more than one part but not checking it. utACK but better to fix both.