Avoid overrunning array when registering pki command line options
authorTobias Brunner <tobias@strongswan.org>
Fri, 28 Sep 2012 16:22:54 +0000 (18:22 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 28 Sep 2012 16:22:54 +0000 (18:22 +0200)
src/pki/command.c

index 07ba5bb..4332857 100644 (file)
@@ -144,7 +144,7 @@ void command_register(command_t command)
        /* append default options, but not to --help */
        if (!active)
        {
-               for (i = 0; i < countof(cmds[registered].options); i++)
+               for (i = 0; i < countof(cmds[registered].options) - 1; i++)
                {
                        if (cmds[registered].options[i].name)
                        {