Advertising

in freeciv version 2.1.3, gtk-2.0 client, in city report screen:
when I do "Select -> Cityzen Governor -> none" and there is at least one city
with CMA active, then the client crashes on a failed assertion:
civclient: cma_fec.c:178: cmafec_preset_get_parameter: Assertion `index >= 0
&& index < cmafec_preset_num()' failed.
This is because cmafec_preset_get_parameter gets CMA_NONE as an argument.
It can be fixed by testing idx != CMA_NONE before calling
cmafec_preset_get_parameter. It is correct because if the city is
CMA-controlled (controlled !=0) and we are selecting non-controlled cities
(idx == CMA_NONE), then we shouldn't select the city under consideration
(select = FALSE).
I attach a log of gdb session (gdb.log) which shows the problem and a fix
(fix-client-CMA-select-none.diff).