Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2004:
[Freeciv-Dev] (PR#10967) helpdlg crash with too-long translated names
Home

[Freeciv-Dev] (PR#10967) helpdlg crash with too-long translated names

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#10967) helpdlg crash with too-long translated names
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 10 Nov 2004 09:52:46 -0800
Reply-to: rt@xxxxxxxxxxx

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

I you have a too-long translated name (specifically for a wonder, but 
probably for anything), then:

1. The wonder name is erronously truncated in helpdata.c.
2. The truncated wonder name is used in the dialog list.
3. The dialog list is so narrow that you can't tell it's truncated.
4. There is no way to resize the dialog list.
5. If you click on the item, it does a failed lookup.
6. After the failed lookup it passes B_LAST to helptext_building.
7. helptext_building crashes on B_LAST.

There are at least 3 bugs here.

#1 is obviously a bug; this patch fixes it.

#3/#4 is also a bug in the gtk2 client.

#6/#7 is a bug. The GUI code assumes that if it can't find the building 
it should pass B_LAST.  But the helpdata code will crash if given 
B_LAST.  Probably the helpdata code should be fixed with a special-case 
if it's given a wrong value.  (And the same for the other helpdata 
functions.)

jason

Index: client/helpdata.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/helpdata.c,v
retrieving revision 1.82
diff -u -r1.82 helpdata.c
--- client/helpdata.c   15 Oct 2004 09:42:32 -0000      1.82
+++ client/helpdata.c   10 Nov 2004 17:47:58 -0000
@@ -235,7 +235,7 @@
           data instead of doing it later on the fly, but I don't want
           to change that now.  --dwp
        */
-       char name[MAX_LEN_NAME + 2];
+       char name[2048];
        struct help_list category_nodes;
        
        help_list_init(&category_nodes);

[Prev in Thread] Current Thread [Next in Thread]