[ircd-ratbox] UNGLINE patch

Dustin Marquess jailbird at alcatraz.fdf.net
Wed Jun 9 13:50:28 EDT 2004


UNGLINE seems to crash if you attempt to remove the last GLINE placed.
This happens because it calls dlinkDestroy to destory the entry at ptr,
and then DLINK_FOREACH tries to use ptr->next.

Attached is a patch to fix this.

-Dustin

-------------- next part --------------
diff -ur ircd-ratbox/modules/m_unkline.c ircd-ratbox.new/modules/m_unkline.c
--- ircd-ratbox/modules/m_unkline.c	2004-05-20 15:35:16.000000000 -0500
+++ ircd-ratbox.new/modules/m_unkline.c	2004-06-09 12:48:08.000000000 -0500
@@ -511,12 +511,13 @@
 {
 	struct ConfItem *aconf;
 	dlink_node *ptr;
+	dlink_node *next_ptr;
 	struct irc_inaddr addr, caddr;
 	int nm_t, cnm_t, bits, cbits;
 
 	nm_t = parse_netmask(host, &addr, &bits);
 
-	DLINK_FOREACH(ptr, glines.head)
+	DLINK_FOREACH_SAFE(ptr, next_ptr, glines.head)
 	{
 		aconf = (struct ConfItem *) ptr->data;
 


More information about the ircd-ratbox mailing list