Wireshark-bugs: [Wireshark-bugs] [Bug 8382] MS-MMS dissector crash

Date: Fri, 01 Mar 2013 20:34:57 +0000

Comment # 27 on bug 8382 from
(In reply to comment #21)
> 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

Once 1.10 branches, we should simplify to only two public tvb string functions:

wmem_strbuf tvb_get_string(wmem_allocator, tvb, offset, length, encoding)
wmem_strbuf tvb_get_stringz(wmem_allocator, tvb, offset, encoding)

Behaviour would be similar to tvb_get_*_enc except using the passed-in wmem
allocator instead. These two functions would be able to subsume at least 12
existing ones by my count. (Note that these functions would still support
manually managed memory if desired, since passing a NULL allocator to wmem will
automatically use manual glib memory).

Thoughts?


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