Ethereal-dev: [Ethereal-dev] Unusual column.c problem

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Jeff Foster <jfoste@xxxxxxxxxxxx>
Date: Fri, 1 Dec 2000 08:05:20 -0600
Trying to convert ethereal to curses I have stumbled on this
problem, in get_column_format if the clp value is null a 
segmentation violation is generated.  I admit this is an 
unusual situation.  However I think a simple sanity check here
could avoid the segmentation violation and either terminate
the program with an error or generate an assert message. 

gint
get_column_format(gint col) {
  GList    *clp = g_list_nth(prefs.col_list, col);
  fmt_data *cfmt;

/*$$$ need to test for clp = 0 here and handle it or quit */
  cfmt = (fmt_data *) clp->data;

  return(get_column_format_from_str(cfmt->fmt));
}


Jeff Foster
jfoste@xxxxxxxxxxxx