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

Date: Fri, 01 Mar 2013 17:02:14 +0000

Comment # 19 on bug 8382 from
(In reply to comment #18)
> Created attachment 10149 [details]
> Remove format_text
> 
> Why is the format_text even necessary?  Can we just provide the string
> returned from tvb_get_ephemeral_unicode_string() directly?  We already know
> the value is going to be bogus/garbage because length > packet length. 
> expert_info may be overkill.

I believe the format_text is necessary in the case that the string contains
null-terminators so that they get escaped properly instead of the string
getting truncated.

Yes, my initial fix breaks that as well.

> I think a "better" solution would be to support "unicode" through
> proto_tree_add_item so some of these extra steps aren't necessary, but you'd
> still have this issue with server_version.

Yes. I think my complaint about tvb_get_string_unicode still stands though: the
calling function has no way to determine the size of the buffer it gets back.
The buffer may contain embedded null-terminators so strlen is unreliable, and
1/2 the requested length is only valid assuming there are no multi-byte
characters.


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