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

index 5c765ba92a0dfb0feca497d34fdf69582bac6543..42fc86629d8f4aa856c156669d64ec4b19f8a8ef 100644 (file)
@@ -57,7 +57,7 @@ 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