Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] (PR#6979) Bug: too long translated string causes client cr
Home

[Freeciv-Dev] (PR#6979) Bug: too long translated string causes client cr

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ggracian@xxxxxxx, mburda@xxxxxxxxx, ukv1@xxxxxxx
Subject: [Freeciv-Dev] (PR#6979) Bug: too long translated string causes client crash
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 22 Aug 2004 23:35:15 -0700
Reply-to: rt@xxxxxxxxxxx

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

The solution is simple.  The client shouldn't impose a restriction on
the length of the name but should just use strdup.  The server shouldn't
used a fixed-size buffer but should also allocate buffers dynamically. 
However the server should impose a maximum number of _characters_.  The
number of characters may be counted without too much difficulty by
converting the string into UCS-4 or just by looping over a UTF-8 string
and counting manually.  Of course if the server uses UCS-4 or UTF-8
internally this is a bit easier.

jason



[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#6979) Bug: too long translated string causes client crash, Jason Short <=