Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Ethereal-dev: Re: [Ethereal-dev] [PATCH] fix crash in packet-aim-signon.c

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: Sun, 11 Apr 2004 13:50:55 -0700
On Sat, Apr 10, 2004 at 07:41:00PM -0400, Jon Oberheide wrote:
> The attached packet dump captured while signing on to AIM using
> gaim-0.76 causes ethereal (CVS) to crash with the following output:
> 
> ** ERROR **: file proto.c: line 1917 (alloc_field_info): assertion
> failed: ((guint)hfindex < gpa_hfinfo.len)

At some point it might be useful to have a language in which to write
dissectors, with a translator to generate C code from that language; the
translator could ensure that every named field has an hf_ value *and* an
entry in the table of fields, and could also perhaps ensure that some
other bugs possible with hand-written C code don't happen.

(Something to translate it to some form of byte code with an interpreter
might be useful as well - if the performance of that is adequate, the
to-C translator wouldn't be necessary, but it might be that the
interpreted version is enough slower that reading in captures,
filtering, etc. isn't fast enough with all-interpreted dissectors.)

> The problem originates when proto_tree_add_item(tree, hf_aim_infotype,
> tvb, offset, 2, FALSE); is called in dissect_aim_snac_signon_signon() in
> packet-aim-signon.c.
> 
> The attached patch resolves the crash.

Checked in.