Skip to content

Commit 9d5b230

Browse files
MarcoFalkeknst
authored andcommitted
Merge bitcoin#24841: test: fix connman UB by calling derived constructor
c848a45 test: fix connman UB by calling derived constructor (chinggg) Pull request description: Hopefully closes bitcoin#24373 by calling `ConnmanTestMsg` test-constructor to avoid undefined behavior in process_message.cpp after casting `g_setup->m_node.connman`. Top commit has no ACKs. Tree-SHA512: c3dce9dcce33614c7b739edf28e416b600ab3d38d16cdb0430490e8ffc9b64aff9292006ae6fe7c636ab0627893bb21f69435893bdfb129a9a865be92baa6f17
1 parent e8b5e1c commit 9d5b230

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/util/setup_common.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <shutdown.h>
3434
#include <streams.h>
3535
#include <test/util/index.h>
36+
#include <test/util/net.h>
3637
#include <txdb.h>
3738
#include <util/strencodings.h>
3839
#include <util/string.h>
@@ -203,7 +204,7 @@ BasicTestingSetup::BasicTestingSetup(const std::string& chainName, const std::ve
203204
sem_str, GetSupportedSocketEventsStr()));
204205
}
205206

206-
m_node.connman = std::make_unique<CConnman>(0x1337, 0x1337, *m_node.addrman, *m_node.netgroupman); // Deterministic randomness for tests.
207+
m_node.connman = std::make_unique<ConnmanTestMsg>(0x1337, 0x1337, *m_node.addrman, *m_node.netgroupman); // Deterministic randomness for tests.
207208

208209
fCheckBlockIndex = true;
209210
m_node.evodb = std::make_unique<CEvoDB>(1 << 20, true, true);

0 commit comments

Comments
 (0)