Merge #9554: [test] Avoid potential NULL pointer dereference in addrman_tests.cpp

afab9f4 [test] Avoid potential NULL pointer dereference in addrman_tests.cpp (practicalswift)
This commit is contained in:
MarcoFalke 2017-01-22 13:17:37 +01:00 committed by Alexander Block
parent c431a7f07a
commit cd04ccd2d9

View File

@ -297,7 +297,7 @@ BOOST_AUTO_TEST_CASE(addrman_find)
// Test 18; Find does not discriminate by port number.
CAddrInfo* info2 = addrman.Find(addr2);
BOOST_CHECK(info2);
if (info2)
if (info2 && info1)
BOOST_CHECK(info2->ToString() == info1->ToString());
// Test 19: Find returns another IP matching what we searched on.