Skip to content

Commit 0b96abc

Browse files
author
MarcoFalke
committed
Merge #9554: [test] Avoid potential NULL pointer dereference in addrman_tests.cpp
afab9f4 [test] Avoid potential NULL pointer dereference in addrman_tests.cpp (practicalswift)
2 parents af01cd3 + afab9f4 commit 0b96abc

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)