Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10641) crash in mapgen
Home

[Freeciv-Dev] (PR#10641) crash in mapgen

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10641) crash in mapgen
From: "James Canete" <use_less@xxxxxxxxxxx>
Date: Wed, 20 Oct 2004 03:22:27 -0700
Reply-to: rt@xxxxxxxxxxx

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

I start up the server, enter these commands:

set mapseed 1
create Idiot
start

and boom, crash.

The problem is in generator/utilities.c, line 111, where it sets minval
and maxval.  On my win32 build, it sets both to -2147483648, probably
due to an overflow in using the positive version of HUGE_VAL.

Here's a patch.

Though, should we be using HUGE_VAL here?  HUGE_VAL is defined as the
value returned by strtod in case of overflow, according to my mingw
include headers, and here we're using it with an int.

Also, I seem to remember a ticket referencing this same place in the
code, but I can't remember what number it was nor find it in the search,
so I apologize in advance if this is a dupe. :)

-James Canete

Attachment: mapgen-crash-fix.diff
Description: Binary data


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