Reply To cazfi
I think there's an actual bug
No upper level code is currently affected. S3_2 & main branch patches address the issue, but as the fix causes savegame format and network protocol breakage, that part is not backported to frozen branches. Also assert to player creation is added only in S3_2 & main.
New versions of main & S3_2 patches, making researches_array big enough.
Clang analyzer S3_1:
I think there's an actual bug that tslot IS left as NULL after the earlier iteration to find a free slot. When called from team_add_player() there might be max number of both players and teams already (both MAX_NUM_PLAYER_SLOTS), *and* the attempt to create a new team is before freeing the old one.