]> git.ipfire.org Git - people/ms/strongswan.git/commitdiff
pki: Print a warning if MAX_COMMANDS is too low
authorTobias Brunner <tobias@strongswan.org>
Wed, 11 Dec 2013 16:23:43 +0000 (17:23 +0100)
committerTobias Brunner <tobias@strongswan.org>
Thu, 23 Jan 2014 09:10:53 +0000 (10:10 +0100)
src/pki/command.c

index 593ff37fb6b7780f2a42b7b486a323179ea52cae..415e78b1024664742417a3eb6098520313d58f28 100644 (file)
@@ -140,6 +140,13 @@ void command_register(command_t command)
 {
        int i;
 
+       if (registered == MAX_COMMANDS)
+       {
+               fprintf(stderr, "unable to register command, please increase "
+                               "MAX_COMMANDS\n");
+               return;
+       }
+
        cmds[registered] = command;
        /* append default options, but not to --help */
        if (!active)