]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: set string table size for safety
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 23 Jul 2018 14:59:09 +0000 (23:59 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 23 Jul 2018 14:59:09 +0000 (23:59 +0900)
src/systemctl/systemctl.c

index d9bef997d593412fdabbb33c1e1016c75ae59089..64584e4a8623d8938f7a67793b2a69d94a8456cb 100644 (file)
@@ -4927,7 +4927,7 @@ typedef enum SystemctlShowMode{
         _SYSTEMCTL_SHOW_MODE_INVALID = -1,
 } SystemctlShowMode;
 
-static const char* const systemctl_show_mode_table[] = {
+static const char* const systemctl_show_mode_table[_SYSTEMCTL_SHOW_MODE_MAX] = {
         [SYSTEMCTL_SHOW_PROPERTIES] = "show",
         [SYSTEMCTL_SHOW_STATUS] = "status",
         [SYSTEMCTL_SHOW_HELP] = "help",