[crossfire] seg. fault with latest commit

Preston Crow pc-crossfire06 at crowcastle.net
Sun Sep 13 20:39:30 CDT 2020


There's a reproducible seg fault in is_identifiable_type() in item.c in 
cases where get_typedata(op->type) return NULL.

I hit this consistently when trying to board a sailing ship.

I'm not totally clear on what is going on, so I won't commit my change, 
but this is what I've found works for me.  Someone who knows the code 
better should commit a fix:

int is_identifiable_type(const object *op) {
     /* Special case -- skill tools don't have an associated identification
      * skill but still need IDing. TODO: we should probably have 
per-tool ID
      * skills, e.g. thievery for lockpicks and thaumaturgy for 
talismans, but
      * currently there's no good way to do this because the 
identifyskill is
      * tied to the itemtype rather than to the arch. */
     if ( op->type == SKILL_TOOL ) return TRUE;
     if ( !get_typedata(op->type) ) return FALSE;
     return get_typedata(op->type)->identifyskill;
}



More information about the crossfire mailing list