Empty test string generates empty vector. Referencing first element of empty vectors creates problem because in ms::std::vector in debug mode there are no allocated buffer to reference (Sort of &nullptr). So I changed the test a bit to accommodate this irregularity.
Fixing base58_tests out of bounds run time error. #4965
pull ENikS wants to merge 2 commits into bitcoin:master from ENikS:vector_subscript_out_of_range changing 1 files +2 −1-
ENikS commented at 3:03 PM on September 23, 2014: contributor
-
Fixing out of bounds run time error. 57c7f1296e
-
theuni commented at 3:20 PM on September 23, 2014: member
nullptr is c++11
-
Update base58_tests.cpp 67f6b38c50
-
BitcoinPullTester commented at 3:51 PM on September 23, 2014: none
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4965_67f6b38c507e408504fd553de58413c6078965d4/ for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.
-
in src/test/base58_tests.cpp:None in 67f6b38c50
38 | @@ -39,8 +39,9 @@ BOOST_AUTO_TEST_CASE(base58_EncodeBase58) 39 | } 40 | std::vector<unsigned char> sourcedata = ParseHex(test[0].get_str()); 41 | std::string base58string = test[1].get_str(); 42 | + const unsigned char * pbegin = (sourcedata.size() != 0) ? &sourcedata.front() : NULL;
laanwj commented at 4:07 PM on September 23, 2014:please use begin_ptr() here, it already implements this logic
ENikS commented at 5:09 PM on September 23, 2014: contributorWill combine them all into one.
ENikS closed this on Sep 23, 2014MarcoFalke locked this on Sep 8, 2021Contributors
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-18 21:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-18 21:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me