Once a melee game has been completed, if you press a
key a NULL pointer dereference occurs in
Ship::calculate() as follows:
if (control)
target = control->target;
// communication code
if ( (nextkeys & keyflag::communicate) &&
(target->exists ()) && (target->isShip()))
{
Ship * s = (Ship*)target;
if( s->ext_ai != NULL )
s->ext_ai->Dialog(this);
}
control is non-NULL, but control->target is NULL when
there are no targets left. Thus, if a key is pressed
there is a NULL pointer dereference here.
Correction simply checks for target == NULL
if ( target != NULL && (nextkeys &
keyflag::communicate) && (target->exists ()) &&
(target->isShip()))
{
Ship * s = (Ship*)target;
if( s->ext_ai != NULL )
s->ext_ai->Dialog(this);
}
Patch as described above, also includes Rogue Pointer patch from #955821