strongswan.org
Wiki/Project Management
Downloads
Gitweb
projects
/
strongswan.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c489c58
)
pki: Check length of commands array before accessing command in --help
author
Martin Willi
<martin@revosec.ch>
Tue, 11 Mar 2014 18:02:16 +0000
(19:02 +0100)
committer
Martin Willi
<martin@revosec.ch>
Wed, 19 Mar 2014 08:25:29 +0000
(09:25 +0100)
As --help is counted as command as well, the array is not null-terminated
and we have to check for MAX_COMMANDS.
Fixes #550.
src/pki/command.c
patch
|
blob
|
history
diff --git
a/src/pki/command.c
b/src/pki/command.c
index
b6966ee
..
c2e0a5d
100644
(file)
--- 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);