Author: cazfi
Date: Mon May  8 15:07:29 2017
New Revision: 35456

URL: http://svn.gna.org/viewcvs/freeciv?rev=35456&view=rev
Log:
Do not access out-of-bounds index A_FUTURE from global_advances[]

Reported by Per M

See hrm Bug #658073

Modified:
    branches/S2_6/server/techtools.c

Modified: branches/S2_6/server/techtools.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/techtools.c?rev=35456&r1=35455&r2=35456&view=diff
==============================================================================
--- branches/S2_6/server/techtools.c    (original)
+++ branches/S2_6/server/techtools.c    Mon May  8 15:07:29 2017
@@ -320,14 +320,16 @@
   struct advance *vap = valid_advance_by_number(tech_found);
   struct city *pcity;
 
+  if (!is_future_tech(tech_found)) {
+
 #ifndef FREECIV_NDEBUG
-  if (!is_future_tech(tech_found)) {
     fc_assert(NULL != vap);
     fc_assert(TECH_KNOWN != research_invention_state(presearch, tech_found));
-  }
 #endif /* FREECIV_NDEBUG */
 
-  was_first = (!game.info.global_advances[tech_found]);
+    was_first = (!game.info.global_advances[tech_found]);
+  }
+
   /* Assign 'advance_name' before we increase the future tech counter. */
   advance_name = research_advance_name_translation(presearch, tech_found);
 


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to