Wireshark-bugs: [Wireshark-bugs] [Bug 8089] New Dissector - SEL (Schweitzer Engineering Laborato

Date: Fri, 14 Dec 2012 14:29:11 +0000

changed bug 8089

What Removed Added
CC   [email protected]

Comment # 7 on bug 8089 from
Very nice work Chris, that's a fairly substantial dissector!

I haven't had time to do a proper review (and probably won't for a while
unfortunately - if someone else wants to grab this feel free), but I did notice
a few things in a quick scan:

- proto_tree_add_item is recommend over proto_tree_add_uint and other
specifically-typed versions when possible. Functions like
dissect_relaydef_frame get a whole bunch of values from the TVB and then pass
them straight into proto_tree_add_uint, where just using proto_tree_add_item
would be preferred (makes the fields better filterable, and is likely faster as
well).

- fmconfig_frame_fast can leak memory when passed a malformed packet. This is
because any tvb accesses (tvb_get_*) can potentially throw an exception,
aborting dissection of that packet and leaving the 'frame' variable out of
scope (and thus not freeable). These cases are why the emem and wmem frameworks
exist, since they guarantee that memory will be freed in such a case (see
doc/README.wmem and the older doc/README.malloc for details).

Cheers,
Evan


You are receiving this mail because:
  • You are watching all bug changes.