Author: cazfi Date: Mon May 8 15:07:23 2017 New Revision: 35455 URL: http://svn.gna.org/viewcvs/freeciv?rev=35455&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/S3_0/server/techtools.c Modified: branches/S3_0/server/techtools.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S3_0/server/techtools.c?rev=35455&r1=35454&r2=35455&view=diff ============================================================================== --- branches/S3_0/server/techtools.c (original) +++ branches/S3_0/server/techtools.c Mon May 8 15:07:23 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