Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] (PR#2554) segfault in tileset_read_toplevel
Home

[Freeciv-Dev] (PR#2554) segfault in tileset_read_toplevel

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#2554) segfault in tileset_read_toplevel
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Wed, 11 Dec 2002 23:40:17 -0800
Reply-to: rt@xxxxxxxxxxxxxx

We fixed this in the isometric case, but not in the non-iso case.  You
can get a segfault by running "civclient -t trident" with the SDL
client.  The correct behavior is just to fall back onto isotrident.

This patch fixes (and makes the function slightly safer) by making the
NULL parameter a defined part of the interface (as the function comment
says it already is).

jason


Index: client//tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.93
diff -u -r1.93 tilespec.c
--- client//tilespec.c  2002/12/11 10:39:41     1.93
+++ client//tilespec.c  2002/12/12 07:31:09
@@ -151,7 +151,7 @@
     tileset_default = "trident";    /* Do not i18n! --dwp */
   }
 
-  if (tileset_name[0] == '\0') {
+  if (!tileset_name || tileset_name[0] == '\0') {
     tileset_name = tileset_default;
   }
 
@@ -385,7 +385,7 @@
     assert(tileset_name != NULL);
     section_file_free(file);
     free(fname);
-    tilespec_read_toplevel("");
+    tilespec_read_toplevel(NULL);
     return;
   }
   if (!is_isometric && !overhead_view_supported()) {

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#2554) segfault in tileset_read_toplevel, Jason Short via RT <=