Skip to content

Commit 791bff9

Browse files
committed
devtools: call common_setup in main
Fixes nullability errors detected by UBSan: wire/fromwire.c:173:46: runtime error: null pointer passed as argument 1, which is declared to never be null external/libwally-core/src/secp256k1/include/secp256k1.h:432:3: note: nonnull attribute specified here #0 0x65214a in fromwire_secp256k1_ecdsa_signature wire/fromwire.c:173:6 #1 0x659500 in printwire_secp256k1_ecdsa_signature devtools/print_wire.c:331:1 #2 0x646ba2 in printwire_channel_update wire/peer_printgen.c:1900:7 #3 0x637182 in printpeer_wire_message wire/peer_printgen.c:128:11 #4 0x65a097 in main devtools/decodemsg.c:85:10
1 parent d774404 commit 791bff9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

devtools/decodemsg.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "common/setup.h"
12
#include "config.h"
23
#include <ccan/err/err.h>
34
#include <ccan/opt/opt.h>
@@ -55,6 +56,7 @@ int main(int argc, char *argv[])
5556
bool (*printwire)(const u8 *msg) = printpeer_wire_message;
5657
bool ok = true;
5758

59+
common_setup(argv[0]);
5860
setup_locale();
5961

6062
opt_register_noarg("--onion", opt_set_onionprint, &printwire,

devtools/route.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "common/setup.h"
12
#include "config.h"
23
#include <ccan/err/err.h>
34
#include <ccan/opt/opt.h>
@@ -70,6 +71,8 @@ int main(int argc, char *argv[])
7071
bool clean_topology = false;
7172
size_t num_channel_updates_rejected;
7273

74+
common_setup(argv[0]);
75+
7376
opt_register_noarg("--clean-topology", opt_set_bool, &clean_topology,
7477
"Clean up topology before run");
7578
opt_register_noarg("-h|--help", opt_usage_and_exit,

0 commit comments

Comments
 (0)