tests: Add tests to make sure lookup methods fail on std::string parameters with embedded NUL characters

This commit is contained in:
practicalswift
2019-12-16 11:46:19 +00:00
parent 9574de86ad
commit fefb9165f2
2 changed files with 20 additions and 1 deletions

View File

@@ -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;