Ethereal-dev: Re: [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: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Fri, 1 Dec 2000 23:05:37 -0800
On Fri, Dec 01, 2000 at 08:05:20AM -0600, Jeff Foster wrote:
> 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.

In "get_column_format()", if the "clp" value is NULL then either

	1) the caller of "get_column_format()" passed a "col" argument
	   that was larger than the number of columns that were specified
	   in the preferences file

or

	2) the "prefs.col_list" list doesn't reflect the columns
	   specified in the preferences file.

In either case, there's a bug somewhere in the code, and the right way
to keep from getting the segmentation violation is to fix the bug...

> 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. 

...not to make "get_column_format()" try to "gracefully" exit.