Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] (PR#10113) genlist_unlink_all bug
Home

[Freeciv-Dev] (PR#10113) genlist_unlink_all bug

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10113) genlist_unlink_all bug
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 14 Sep 2004 15:54:25 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10113 >

Apparently nobody uses genlist_unlink_all.  There's a bug because of a 
missing NULL check.

jason

? settler_recursion_crash
Index: utility/genlist.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/utility/genlist.c,v
retrieving revision 1.15
diff -u -r1.15 genlist.c
--- utility/genlist.c   14 Sep 2004 21:10:44 -0000      1.15
+++ utility/genlist.c   14 Sep 2004 22:53:51 -0000
@@ -100,7 +100,7 @@
       plink = plink->next;
     }
     
-    if(plink->dataptr==punlink) {
+    if (plink && plink == punlink) {
       if(pgenlist->head_link==plink)
         pgenlist->head_link=plink->next;
       else

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#10113) genlist_unlink_all bug, Jason Short <=