ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] malformed packet for no reason

From: Dirk Jagdmann <doj@xxxxxxxxx>
Date: Mon, 21 Mar 2011 19:18:46 -0700
I guess the packet you are trying to dissect is shorter than your two loops over
i and j assume. In your inner loop you do something like:

*plen += data_size;

So plen will be greater than num_of_data_arrs*num_of_data_chunks*data_size
bytes. Then you do a

val_ptr = tvb_get_ptr(tvb, *plen, data_size);

But tvb_get_ptr() can return NULL when out of bounds of the current packet. I
guess this condition is reached on your 6th iteration.

---> Dirk Jagdmann