diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2025-04-05 20:02:09 +0200 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2025-04-05 20:02:09 +0200 |
commit | 7b6d1973e34327e5b93543222245e81a0f73bc99 (patch) | |
tree | 3d92f049ec06c2c9e1455020293015c5f7ba8c1b /FICS/command.c | |
parent | f0c3789064dbc4e78cffc2e90571dac1224c4955 (diff) |
Fixed program logic mistakes, found by PVS-Studio
Diffstat (limited to 'FICS/command.c')
-rw-r--r-- | FICS/command.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/FICS/command.c b/FICS/command.c index 528bdf9..569c27a 100644 --- a/FICS/command.c +++ b/FICS/command.c @@ -132,7 +132,11 @@ parse_command(char *com_string, char **comm, char **parameters) PUBLIC int alias_lookup(char *tmp, alias_type *alias_list, int numalias) { - for (int i = 0; (alias_list[i].comm_name && i < numalias); i++) { + if (numalias >= MAX_ALIASES) + return -1; + for (int i = 0; + (i < numalias && alias_list[i].comm_name != NULL); + i++) { if (!strcmp(tmp, alias_list[i].comm_name)) return i; } |