Browse Source

hsmtool: don't streq() on NULL

This would cause a segfault on the default network parameter for
`dumponchaindescriptors`.

Introduced in 1513a2d07e

Changelog-Fixed: hsmtool: fix a segfault on `dumponchaindescriptors` without network parameter
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
ppa
Antoine Poinsot 4 years ago
committed by Christian Decker
parent
commit
48595674fa
  1. 4
      tools/hsmtool.c

4
tools/hsmtool.c

@ -660,9 +660,9 @@ int main(int argc, char *argv[])
if (deprecated_apis && argc > 4)
net = argv[4];
if (streq(net, "testnet"))
if (net && streq(net, "testnet"))
is_testnet = true;
else if (!streq(net, "bitcoin"))
else if (net && !streq(net, "bitcoin"))
errx(ERROR_USAGE, "Network '%s' not supported."
" Supported networks: bitcoin (default),"
" testnet", net);

Loading…
Cancel
Save