]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
swanctl: Make sure options array passed to getopt_long() ends with a NULL entry
authorTobias Brunner <tobias@strongswan.org>
Mon, 18 May 2026 13:20:27 +0000 (15:20 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 19 May 2026 15:27:33 +0000 (17:27 +0200)
src/swanctl/command.c

index dd662eef087bbf72c981a071f86a57510e471c85..368a7e389c206f5623c4600ba20b7b87e13ffb12 100644 (file)
@@ -62,8 +62,8 @@ static options_t *options;
 /**
  * Global options used by all subcommands
  */
-static struct option command_opts[MAX_COMMANDS > MAX_OPTIONS ?
-                                                                       MAX_COMMANDS : MAX_OPTIONS];
+static struct option command_opts[(MAX_COMMANDS > MAX_OPTIONS ?
+                                                                       MAX_COMMANDS : MAX_OPTIONS) + 1];
 
 /**
  * Global optstring used by all subcommands