diff options
author | Martin Willi <martin@revosec.ch> | 2014-03-11 19:02:16 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2014-03-19 09:25:29 +0100 |
commit | 87e53819a6dd6c788fc74f4d9157a987766b6682 (patch) | |
tree | 20a44c7e7bcb4a34626e9b9abd92ff9efa09df56 /src/pki/command.c | |
parent | c489c5881a1d47a18ff47625deaf2bdf7245e5a0 (diff) | |
download | strongswan-87e53819a6.tar.bz2 strongswan-87e53819a6.tar.xz |
pki: Check length of commands array before accessing command in --help
As --help is counted as command as well, the array is not null-terminated
and we have to check for MAX_COMMANDS.
Fixes #550.
Diffstat (limited to 'src/pki/command.c')
-rw-r--r-- | src/pki/command.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pki/command.c b/src/pki/command.c index b6966ee0b..c2e0a5d0a 100644 --- a/src/pki/command.c +++ b/src/pki/command.c @@ -200,7 +200,7 @@ int command_usage(char *error) fprintf(out, "usage:\n"); if (active == help_idx) { - for (i = 0; cmds[i].cmd; i++) + for (i = 0; i < MAX_COMMANDS && cmds[i].cmd; i++) { fprintf(out, " pki --%-7s (-%c) %s\n", cmds[i].cmd, cmds[i].op, cmds[i].description); |