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:
Peter Neuroth 2023-11-24 16:51:30 +01:00
parent 194dd2bb7d
commit 9d40a165a0

View file

@ -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]);
}