diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2019-12-16 11:46:19 +0000 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2020-01-08 12:35:59 +0000 |
commit | fefb9165f23fe9d10ad092ec31715f906e0d2ee7 (patch) | |
tree | 9933f815e4c7b834f8b0b1dc26d54647ba1b25a5 /src/test/net_tests.cpp | |
parent | 9574de86ad703ad942cdd0eca79f48c0d42b102b (diff) | |
download | bitcoin-fefb9165f23fe9d10ad092ec31715f906e0d2ee7.tar.xz |
tests: Add tests to make sure lookup methods fail on std::string parameters with embedded NUL characters
Diffstat (limited to 'src/test/net_tests.cpp')
-rw-r--r-- | src/test/net_tests.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/test/net_tests.cpp b/src/test/net_tests.cpp index daf7fea6ad..cb1ef5dcf3 100644 --- a/src/test/net_tests.cpp +++ b/src/test/net_tests.cpp @@ -99,6 +99,8 @@ BOOST_AUTO_TEST_CASE(caddrdb_read) BOOST_CHECK(Lookup("250.7.1.1", addr1, 8333, false)); BOOST_CHECK(Lookup("250.7.2.2", addr2, 9999, false)); BOOST_CHECK(Lookup("250.7.3.3", addr3, 9999, false)); + BOOST_CHECK(Lookup(std::string("250.7.3.3", 9), addr3, 9999, false)); + BOOST_CHECK(!Lookup(std::string("250.7.3.3\0example.com", 21), addr3, 9999, false)); // Add three addresses to new table. CService source; |