Wireshark-bugs: [Wireshark-bugs] [Bug 8382] MS-MMS dissector crash
Date: Fri, 01 Mar 2013 17:31:33 +0000

Comment # 21 on bug 8382 from
Ugh, this is getting messy. Stepping back for a moment, I think the following
is what *should* be; if we agree on this then we can start identifying places
where we don't do what we should:

- tvb_get_string_* functions should preserve embedded nulls, as they should be
just dumb getters from the tvb

- tvb_get_string_* functions should provide the length of the returned string,
since with multi-byte characters and embedded nulls, the caller has no other
way of determining this value

- the ms-mms dissector should be checking for overflow when doubling a value it
gets from the packet

- the ms-mms dissector should be using proto_tree_add_unicode_string for
strings it gets via tvb_get_ephemeral_unicode_string

- it should be possible to add multibyte unicode strings (UCS-2, UTF-16, UCS-4,
etc) to the tree with proto_tree_add_item and the appropriate encoding
arguments

- calling format_str is necessary when passing a packet-derived string into
proto_tree_add_string, col_append_fstr and friends. These functions could
potentially call format_str themselves on every string they get, but the
performance hit would be big. Faster to continue calling it only where needed.

Can you think of anything else?


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