pki: Also check for MAX_COMMANDS when building getopt_long arguments

Completes 87e53819a6 and 0a8c399a21.
This commit is contained in:
Tobias Brunner 2014-06-20 17:55:48 +02:00
parent d82aa931db
commit bb91109af8
1 changed files with 1 additions and 1 deletions

View File

@ -73,7 +73,7 @@ static void build_opts()
memset(command_optstring, 0, sizeof(command_optstring));
if (active == help_idx)
{
for (i = 0; cmds[i].cmd; i++)
for (i = 0; i < MAX_COMMANDS && cmds[i].cmd; i++)
{
command_opts[i].name = cmds[i].cmd;
command_opts[i].val = cmds[i].op;