Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] (PR#11558) specialist arrays aren't limited in the packet
Home

[Freeciv-Dev] (PR#11558) specialist arrays aren't limited in the packet

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11558) specialist arrays aren't limited in the packet
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 16 Dec 2004 15:13:16 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=11558 >

The server doesn't limit the size of a specialist array in the packet. 
It's easy to limit it (for strings or 1-dimensional arrays only however) 
and it lowers the packet size and prevents the client from doing an 
invalid iconv string conversion on the garbage strings.

-jason

Index: common/capstr.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/capstr.c,v
retrieving revision 1.210
diff -u -r1.210 capstr.c
--- common/capstr.c     16 Dec 2004 20:37:49 -0000      1.210
+++ common/capstr.c     16 Dec 2004 23:07:16 -0000
@@ -82,7 +82,7 @@
  *     as long as possible.  We want to maintain network compatibility with
  *     the stable branch for as long as possible.
  */
-#define CAPABILITY "+Freeciv.Devel.2004.Dec.16"
+#define CAPABILITY "+Freeciv.Devel.2004.Dec.16b"
 
 void init_our_capability(void)
 {
Index: common/packets.def
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets.def,v
retrieving revision 1.79
diff -u -r1.79 packets.def
--- common/packets.def  16 Dec 2004 20:37:49 -0000      1.79
+++ common/packets.def  16 Dec 2004 23:07:16 -0000
@@ -969,9 +969,9 @@
 
 PACKET_RULESET_GAME=97;sc,lsend
   UINT8 default_specialist, num_specialist_types;
-  STRING specialist_name[SP_MAX][MAX_LEN_NAME];
-  STRING specialist_short_name[SP_MAX][MAX_LEN_NAME];
-  UINT8 specialist_min_size[SP_MAX];
+  STRING specialist_name[SP_MAX:num_specialist_types][MAX_LEN_NAME];
+  STRING specialist_short_name[SP_MAX:num_specialist_types][MAX_LEN_NAME];
+  UINT8 specialist_min_size[SP_MAX:num_specialist_types];
   UINT8 specialist_bonus[SP_MAX * O_MAX];
   BOOL changable_tax;
   UINT8 forced_science;

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#11558) specialist arrays aren't limited in the packet, Jason Short <=