This commit is contained in:
Zhi Guan
2026-06-17 16:07:18 +08:00
parent ea35a8cea3
commit f38142d35e
4 changed files with 8 additions and 2 deletions

View File

@@ -81,6 +81,10 @@ int hsskeygen_main(int argc, char **argv)
tok = strtok(lms_types_str, ":");
while (tok) {
if (levels >= sizeof(lms_types_val)/sizeof(lms_types_val[0])) {
fprintf(stderr, "%s: too many lms types\n", prog);
goto end;
}
if (!(lms_types_val[levels] = lms_type_from_name(tok))) {
fprintf(stderr, "%s: invalid lms_type `%s`\n", prog, tok);
goto end;