mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 14:24:09 +01:00
hsmtool: Fix argc check on getcodexsecret
This caused a segmentation fault when calling `getcodexsecret` without id. Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com> Changelog-Fixed: Hsmtool: Fix segmentation fault when calling `getcodexsecret` without id.
This commit is contained in:
parent
194dd2bb7d
commit
9d40a165a0
1 changed files with 2 additions and 2 deletions
|
@ -47,7 +47,7 @@ static void show_usage(const char *progname)
|
|||
printf(" - dumponchaindescriptors <path/to/hsm_secret> [network]\n");
|
||||
printf(" - makerune <path/to/hsm_secret>\n");
|
||||
printf(" - getcodexsecret <path/to/hsm_secret> <id>\n");
|
||||
printf(" - getemergencyrecover <path/to/emergency.recover>\n");
|
||||
printf(" - getemergencyrecover <path/to/emergency.recover>\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
@ -788,7 +788,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
if(streq(method, "getcodexsecret")) {
|
||||
if (argc < 2)
|
||||
if (argc < 4)
|
||||
show_usage(argv[0]);
|
||||
return make_codexsecret(argv[2], argv[3]);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue