systemctl: set string table size for safety

This commit is contained in:
Yu Watanabe
2018-07-23 23:59:09 +09:00
parent 08540a9591
commit aa8d423ef9

View 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",