Skip to content

Commit afab9f4

Browse files
[test] Avoid potential NULL pointer dereference in addrman_tests.cpp
1 parent 02e5308 commit afab9f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/test/addrman_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ BOOST_AUTO_TEST_CASE(addrman_find)
297297
// Test 18; Find does not discriminate by port number.
298298
CAddrInfo* info2 = addrman.Find(addr2);
299299
BOOST_CHECK(info2);
300-
if (info2)
300+
if (info2 && info1)
301301
BOOST_CHECK(info2->ToString() == info1->ToString());
302302

303303
// Test 19: Find returns another IP matching what we searched on.

0 commit comments

Comments
 (0)