Ethereal-dev: [Ethereal-dev] proto_tree_add_item with NULL tree

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:04:52 -0600
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.

Thanks,

	Andy