1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-03 15:13:13 +02:00

- Use safe list iteration with loops which may remove clients

This commit is contained in:
William Pitcock
2012-11-22 02:16:59 +00:00
parent 9a577aec61
commit 35dcc7287d
+5 -5
View File
@@ -477,15 +477,15 @@ EVENT(try_connections)
*/
void check_tkls(void)
{
aClient *cptr = NULL;
aClient *cptr, *cptr2;
ConfigItem_ban *bconf = NULL;
char killflag = 0;
char banbuf[1024];
list_for_each_entry(cptr, &lclient_list, lclient_node)
list_for_each_entry_safe(cptr, cptr2, &lclient_list, lclient_node)
{
if (find_tkline_match(cptr, 0) < 0)
continue;
continue;
find_shun(cptr);
if (!killflag && IsPerson(cptr)) {
@@ -563,7 +563,7 @@ void check_tkls(void)
*/
EVENT(check_pings)
{
aClient *cptr = NULL;
aClient *cptr, *cptr2;
ConfigItem_ban *bconf = NULL;
char killflag = 0;
int i = 0;
@@ -572,7 +572,7 @@ EVENT(check_pings)
int ping = 0;
TS currenttime = TStime();
list_for_each_entry(cptr, &lclient_list, lclient_node)
list_for_each_entry_safe(cptr, cptr2, &lclient_list, lclient_node)
{
/*
* ** Note: No need to notify opers here. It's