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

Wireshark-dev: Re: [Wireshark-dev] Segmentation Fault in Simple Dissector-Plugin

From: Patrick Nowak <student.nowak@xxxxxxxxxx>
Date: Wed, 24 Nov 2010 16:18:35 +0100
Hey,

thanks for your reply!

proto_slapml should be proto_testdissect, thats right. I just forgot to
rename it, after I copied the source-code into the email, in the
original version the code does compile.
So I guess the error comes from your third suggestion. I will look into it!

Regards,
Patrick

Am 24.11.2010 16:08, schrieb news.gmane.com:
> "Patrick Nowak" <student.nowak@xxxxxxxxxx> 
> wrote in message news:4CECF80A.8040507@xxxxxxxxxx...
>> Hello,
>>
>> I am fairly new to developing Dissectors for Wireshark. I started with
>> the small sample from the Wireshark Developers Guide and changed a few
>> things(Strings and Port).
>>
>> My Plugin looks like this:
> Your code does not compile.
>
> 1. proto_slapml is not defined. You pass the return value of 
> proto_register_protocol to this variable.
>
> 2. proto_testdissect is -1 and can cause this exception, when you pass this 
> to proto_tree_add_item.
>
> 3. The function proto_tree_add_item does not expect a return value from 
> proto_register_protocol but a hf index created by 
> proto_register_field_array.
> see prototype:
> proto_tree *proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t 
> *tvb,
>     gint start, gint length, gboolean little_endian);
>
>
> Andy
>
>
>
> ___________________________________________________________________________
> Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
> Archives:    http://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
>              mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe