Wireshark-bugs: [Wireshark-bugs] [Bug 4505] Wireshark crashes during IEEE 802.15.4 decryption
Date: Fri, 19 Feb 2010 17:01:55 -0800 (PST)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4505

--- Comment #6 from Guy Harris <guy@xxxxxxxxxxxx> 2010-02-19 17:01:54 PST ---
        add_new_data_source(pinfo, ptext_tvb, "IEEE 802.15.4 decryption");

"Decrypted IEEE 802.15.4 payload" might be a better name - the names of the
data sources, which appear as the names of the tabs for the data sources,
should sound like a name for what the data is.  (Other dissectors that do
decryption have names like that.)

        ptext_tvb = tvb_new_subset(tvb, offset, captured_len, reported_len);
        tvb_set_reported_length(ptext_tvb, reported_len);

The second call is redundant - the first call sets the reported length of the
resulting tvbuff to reported_len.

         * And yes, despite the warning in tvbuff.h, I think tvb_get_ptr is the
         * right function here since either A) the payload wasn't encrypted, in

It is.  This is one of those cases where it's the right function to use.  You
want a pointer to a contiguous blob of bytes, and you *aren't* going to be
parsing its contents yourself.  The comment's main purpose is to VERY VERY VERY
STRONGLY discourage people from using tvb_get_ptr() to get a pointer to the
packet data and then extract values from it themselves, rather than using the
tvb_get_XXX routines.

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.