diff options
Diffstat (limited to 'FICS')
| -rw-r--r-- | FICS/lists.c | 10 | ||||
| -rw-r--r-- | FICS/matchproc.c | 5 |
2 files changed, 12 insertions, 3 deletions
diff --git a/FICS/lists.c b/FICS/lists.c index e93dd5b..f82a7c9 100644 --- a/FICS/lists.c +++ b/FICS/lists.c @@ -306,8 +306,14 @@ list_addsub(int p, char *list, char *who, int addsub) return COM_OK; member = who; // allow sub removed/renamed player loadme = 0; - } else - member = parray[p1].name; + } else { + if (p1 < 0) { + warnx("%s: unexpected negative number", + __func__); + return COM_OK; + } else + member = parray[p1].name; + } } else { member = who; } diff --git a/FICS/matchproc.c b/FICS/matchproc.c index 1b1eab8..7288bf0 100644 --- a/FICS/matchproc.c +++ b/FICS/matchproc.c @@ -991,7 +991,10 @@ com_match(int p, param_list param) } } else { ppend = pendto; - p1pend = player_find_pendfrom(p1, p, PEND_MATCH); + if ((p1pend = player_find_pendfrom(p1, p, PEND_MATCH)) < 0) { + pprintf(p, "Unable to find pending match\n"); + return COM_OK; + } } parray[p].p_to_list[ppend].param1 = wt; |
