Skip to content

Commit 4859567

Browse files
darosiorcdecker
authored andcommitted
hsmtool: don't streq() on NULL
This would cause a segfault on the default network parameter for `dumponchaindescriptors`. Introduced in 1513a2d Changelog-Fixed: hsmtool: fix a segfault on `dumponchaindescriptors` without network parameter Signed-off-by: Antoine Poinsot <[email protected]>
1 parent 4dfbee4 commit 4859567

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/hsmtool.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,9 +660,9 @@ int main(int argc, char *argv[])
660660
if (deprecated_apis && argc > 4)
661661
net = argv[4];
662662

663-
if (streq(net, "testnet"))
663+
if (net && streq(net, "testnet"))
664664
is_testnet = true;
665-
else if (!streq(net, "bitcoin"))
665+
else if (net && !streq(net, "bitcoin"))
666666
errx(ERROR_USAGE, "Network '%s' not supported."
667667
" Supported networks: bitcoin (default),"
668668
" testnet", net);

0 commit comments

Comments
 (0)