Ethereal-dev: Re: [Ethereal-dev] Multiline in COL_PROTOCOL and COL_INFO

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

From: Guy Harris <gharris@xxxxxxxxx>
Date: Tue, 10 Jun 2003 11:13:35 -0700
On Mon, Jun 09, 2003 at 09:37:27AM +0200, Tomas Kukosa wrote:
>   I have made some changes to support multiline text in the COL_PROTOCOL
> and COL_INFO. Unlike my changes last week it supports GUI too.
>   This feature can be switched on in Preferences.../User
> Interface/Multiline packet list.
> If this feature is switched on then the "\n" character is checked in the
> COL_PROTOCOL
> and COL_INFO columns and the text is split into more lines.

Unfortunately, it is not always the case that you can split the text;
"col_set_str()" sets the column text pointer to point to the string
supplied by the caller, rather than copying the text (this saves, as I
remember from when I did some profiled runs, reading in large captures,
a significant amount of CPU time), and that string might not be writable
(and even if it *is* writable, the column code shouldn't change it, as
it might, for example, be a string constant).

I.e., "packet_list_append()" can't safely do

	ch = lnp[len]; lnp[len] = '\0';

because "lnp" might point to a read-only portion of the address space.

> Note: there are two different possible features:
> 1) multiline text in some columns
> 2) multiple rows per packet
> My patch solve the 1st feature. The 2nd feature can be implemented
> independently and both can be used together.

What is the purpose of multiline text in a column - especially in the
Protocol column?