mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
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>
This commit is contained in:
parent
4dfbee47f7
commit
48595674fa
@ -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…
Reference in New Issue
Block a user