[Freeciv-Dev] Re: (PR#14514) segmentation fault when using /rulesetdir f
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=14514 >
Dnia 2005-11-01 02:27:52, Curtis napisał(a):
>
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=14514 >
>
> When sending the the command '/rulsetdir [whatever]' from the server
> segmentation faults due to a bad pointer. The following is the gdb
> session of the server during said events. As I do not know much about
> this particular area of code, I will leave the fix to someone else.
>
Here's a patch
--
mateusz
Index: server/ruleset.c
===================================================================
--- server/ruleset.c (wersja 11206)
+++ server/ruleset.c (kopia robocza)
@@ -3063,6 +3063,7 @@
{
players_iterate(pplayer) {
pplayer->nation = NO_NATION_SELECTED;
+ pplayer->city_style = 0;
} players_iterate_end;
send_player_info_c(NULL, game.est_connections);
}
Index: server/plrhand.c
===================================================================
--- server/plrhand.c (wersja 11206)
+++ server/plrhand.c (kopia robocza)
@@ -889,7 +889,11 @@
packet->is_male=plr->is_male;
packet->team = plr->team ? plr->team->index : -1;
packet->is_ready = plr->is_ready;
- packet->city_style = get_player_city_style(plr);
+ if (city_styles != NULL) {
+ packet->city_style = get_player_city_style(plr);
+ } else {
+ packet->city_style = 0;
+ }
packet->is_alive=plr->is_alive;
packet->is_connected=plr->is_connected;
- [Freeciv-Dev] Re: (PR#14514) segmentation fault when using /rulesetdir from client,
Mateusz Stefek <=
|
|