diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-03-31 10:18:14 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-03-31 10:21:38 +0200 |
commit | de301b048810c52df3c04bdae6b44a4933016bab (patch) | |
tree | 6e7db5cc3ca8c76d23fed23df9ca6a72edf4b99a /src | |
parent | 8e4f7e72410df3ba430082c7cf385f26fd75b033 (diff) | |
parent | 19ecd1e2e13514c8a92a2a4337c2568c3d5d13e5 (diff) | |
download | bitcoin-de301b048810c52df3c04bdae6b44a4933016bab.tar.xz |
Merge #10130: bitcoin-tx input verification (awemany, jnewbery)
19ecd1e Add tests for bitcoin-tx input checking (John Newbery)
21704f6 Check stderr when testing bitcoin-tx (John Newbery)
eb66bf9 bitcoin-tx: Fix missing range check (Awemany)
Tree-SHA512: 08c6153cf7dd5e0ecd23e24d81af4c0f17534d484179dd91dcd78d42df14c91284341d31cc695469a64c507bce72c34231748b7cabb7df8f1051d228fb0a62c5
Diffstat (limited to 'src')
-rw-r--r-- | src/bitcoin-tx.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 61e0eb74e6..83b855cbcf 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -242,6 +242,9 @@ static void MutateTxAddOutAddr(CMutableTransaction& tx, const std::string& strIn std::vector<std::string> vStrInputParts; boost::split(vStrInputParts, strInput, boost::is_any_of(":")); + if (vStrInputParts.size() != 2) + throw std::runtime_error("TX output missing or too many separators"); + // Extract and validate VALUE CAmount value = ExtractAndValidateValue(vStrInputParts[0]); @@ -264,6 +267,9 @@ static void MutateTxAddOutPubKey(CMutableTransaction& tx, const std::string& str std::vector<std::string> vStrInputParts; boost::split(vStrInputParts, strInput, boost::is_any_of(":")); + if (vStrInputParts.size() < 2 || vStrInputParts.size() > 3) + throw std::runtime_error("TX output missing or too many separators"); + // Extract and validate VALUE CAmount value = ExtractAndValidateValue(vStrInputParts[0]); |