diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2019-11-18 15:26:55 -0800 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2019-12-05 16:31:09 -0800 |
commit | 5909bcd3bf3c3502355e89fd0b76bb8e93d8a95b (patch) | |
tree | 388569d03abf646a5b616c7a68e4611d0f2cf0a3 /src/test/base58_tests.cpp | |
parent | 2bcf1fc444d5c4b8efa879e54e7b6134b7e6b986 (diff) |
Add bounds checks in key_io before DecodeBase58Check
Diffstat (limited to 'src/test/base58_tests.cpp')
-rw-r--r-- | src/test/base58_tests.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/base58_tests.cpp b/src/test/base58_tests.cpp index 5d53088cc6..96fdf8c86d 100644 --- a/src/test/base58_tests.cpp +++ b/src/test/base58_tests.cpp @@ -54,15 +54,15 @@ BOOST_AUTO_TEST_CASE(base58_DecodeBase58) } std::vector<unsigned char> expected = ParseHex(test[0].get_str()); std::string base58string = test[1].get_str(); - BOOST_CHECK_MESSAGE(DecodeBase58(base58string, result), strTest); + BOOST_CHECK_MESSAGE(DecodeBase58(base58string, result, 256), strTest); BOOST_CHECK_MESSAGE(result.size() == expected.size() && std::equal(result.begin(), result.end(), expected.begin()), strTest); } - BOOST_CHECK(!DecodeBase58("invalid", result)); + BOOST_CHECK(!DecodeBase58("invalid", result, 100)); // check that DecodeBase58 skips whitespace, but still fails with unexpected non-whitespace at the end. - BOOST_CHECK(!DecodeBase58(" \t\n\v\f\r skip \r\f\v\n\t a", result)); - BOOST_CHECK( DecodeBase58(" \t\n\v\f\r skip \r\f\v\n\t ", result)); + BOOST_CHECK(!DecodeBase58(" \t\n\v\f\r skip \r\f\v\n\t a", result, 3)); + BOOST_CHECK( DecodeBase58(" \t\n\v\f\r skip \r\f\v\n\t ", result, 3)); std::vector<unsigned char> expected = ParseHex("971a55"); BOOST_CHECK_EQUAL_COLLECTIONS(result.begin(), result.end(), expected.begin(), expected.end()); } |