Ethereal-dev: Re: [Ethereal-dev] Creating a SPRT dissecot

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

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Wed, 5 Nov 2003 12:26:30 -0800

On Nov 5, 2003, at 11:53 AM, adam.smith@xxxxxxxxxx wrote:

	g_assert(hfindex >= 0 && (guint) hfindex < gpa_hfinfo->len);

Can anyone tell me why this assertion is failing.

You're probably passing to one of the "proto_tree_add" routines a bad hf_ index. You might, for example, have a field for which you've defined an hf_ variable:

	static int hf_sprt_foo = -1;

and be doing

	proto_tree_add_item(sprt_tree, hf_sprt_foo, tvb, offset, 4, FALSE);

(or something such as that), but you might not have registered the "foo" field by putting in an entry for it in the "hf[]" array in your "proto_register_sprt()" routine.