Ethereal-dev: Re: [Ethereal-dev] proto_tree_add_item with NULL tree - never mind

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

From: Andy Howell <AndyHowell@xxxxxxxxxxxxx>
Date: Fri, 12 Nov 2004 10:15:12 -0600
Andy Howell wrote:

Sorry, jumped the gun. I must be see the problem for some other reason. I see proto_tree_add_item check for a NULL tree.

The README.developer indicates that it is ok to call the proto_tree_add_xxx funcs when the tree is null. If I do this howver, I get a core in proto.c line 2078 alloc_field_info. Its doing:

if(!PTREE_DATA(tree)->visible) {
	FI_SET_FLAG(fi, FI_HIDDEN);
}

Shouldn't there be test for tree being NULL?

Or should I avoid doing any proto_tree_add_xxx with a null tree. Doing so complicates my code a fair bit because I want to set the COL_INFO with some data deep within my packet.