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

 With altering movement phase can end being 32, causing crash in
client update_info_label(). Fix attached.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/packhand.c freeciv/client/packhand.c
--- freeciv/client/packhand.c   2008-07-09 10:44:51.000000000 +0300
+++ freeciv/client/packhand.c   2008-07-19 22:02:43.000000000 +0300
@@ -882,6 +882,7 @@
 
   if (phase < 0 || phase >= game.info.nplayers) {
     /* Illegal phase */
+    /* Note that illegal phase can be set by game info packet! */
     freelog(LOG_ERROR, "Illegal phase %d received from server!", phase);
     return;
   }
diff -Nurd -X.diff_ignore freeciv/server/srv_main.c freeciv/server/srv_main.c
--- freeciv/server/srv_main.c   2008-07-09 10:44:51.000000000 +0300
+++ freeciv/server/srv_main.c   2008-07-19 22:08:57.000000000 +0300
@@ -1878,6 +1878,9 @@
        break;
       }
     }
+    /* Phase number was set to illegal value after last round in loop. Fix. */
+    game.info.phase = 0;
+
     end_turn();
     freelog(LOG_DEBUG, "Sendinfotometaserver");
     (void) send_server_info_to_metaserver(META_REFRESH);
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to