From: Joseph Bongaarts Date: Sun, 10 Mar 2002 10:17:14 +0000 (+0000) Subject: Author: Ghostwolf X-Git-Url: http://git.pk910.de/?a=commitdiff_plain;h=50493e2fbf96c96eb151e69ce860f0ef43f4835e;p=ircu2.10.12-pk.git Author: Ghostwolf Log message: Don't remove clients from the list that aren't actually in the list. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@670 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index d3b33e7..e5bc07c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-03-10 Joseph Bongaarts + + * ircd/list.c: Don't remove clients from the linked list + that aren't actually in the list. + 2002-03-08 Carlo Wood * include/channel.h: Added CHFL_BURST_ALREADY_OPPED and CHFL_BURST_ALREADY_VOICED. diff --git a/ircd/list.c b/ircd/list.c index ebb637e..79dab30 100644 --- a/ircd/list.c +++ b/ircd/list.c @@ -312,17 +312,22 @@ void remove_client_from_list(struct Client *cptr) assert(con_verify(cli_connect(cptr))); assert(!cli_prev(cptr) || cli_verify(cli_prev(cptr))); assert(!cli_next(cptr) || cli_verify(cli_next(cptr))); + assert(!IsMe(cptr)); - if (cli_prev(cptr)) - cli_next(cli_prev(cptr)) = cli_next(cptr); - else { - GlobalClientList = cli_next(cptr); - if (GlobalClientList) + /* Only try to remove cptr from the list if it IS in the list. + * cli_next(cptr) cannot be NULL here, as &me is always the end + * the list, and we never remove &me. -GW + */ + if(cli_next(cptr)) + { + if (cli_prev(cptr)) + cli_next(cli_prev(cptr)) = cli_next(cptr); + else { + GlobalClientList = cli_next(cptr); cli_prev(GlobalClientList) = 0; - } - if (cli_next(cptr)) + } cli_prev(cli_next(cptr)) = cli_prev(cptr); - + } cli_next(cptr) = cli_prev(cptr) = 0; if (IsUser(cptr) && cli_user(cptr)) {