transfer_city(): NULL could_see_unit[i] for BV_CLR_ALL(could_see_unit[i])
Clang analyzer (this particular run on S3_1, but I assume all branches affected):
../../../src/server/citytools.c:1099:5: warning: Null pointer passed to 1st parameter expecting 'nonnull' [core.NonNullParamChecker] BV_CLR_ALL(could_see_unit[i]); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../src/utility/bitvector.h:92:6: note: expanded from macro 'BV_CLR_ALL' memset((bv).vec, 0, sizeof((bv).vec)); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../src/server/citytools.c:1193:14: warning: Array access (via field 'vec') results in a null pointer dereference [core.NullDereference] if (!BV_ISSET(could_see_unit[i], player_index(aplayer)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../src/utility/bitvector.h:75:5: note: expanded from macro 'BV_ISSET' ((bv).vec[_BV_BYTE_INDEX(bit)] & _BV_BITMASK(bit)) != 0) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../src/server/citytools.c:1199:13: warning: Array access (via field 'vec') results in a null pointer dereference [core.NullDereference] if (BV_ISSET(could_see_unit[i], player_index(aplayer))) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../src/utility/bitvector.h:75:5: note: expanded from macro 'BV_ISSET' ((bv).vec[_BV_BYTE_INDEX(bit)] & _BV_BITMASK(bit)) != 0) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Clang analyzer (this particular run on S3_1, but I assume all branches affected):