Comment # 12
on bug 9323
from Evan Huus
(In reply to comment #11)
> (In reply to comment #10)
> > Fixed in r52905 and put on the roadmap for 1.10.3 and 1.8.11.
>
> I'm not a fan of this patch.
> In FT_STRING[Z] value we must always have UTF-8 encoded string,
> but if have some protocol using ISO-8859-* encoding or other original
> *length* of string can be shorter than generated UTF-8 sequence sequence.
Damn, I think you're right. In which case we have to do one of:
- require passing a second length parameter (the number of bytes) around
everywhere as well
- require strings to be null-terminated all the time
I don't like either of those. Accounting for all the variations, there are
~2000 instances of proto_tree_add_string in the codebase, so any API changes
that aren't search/replaceable are basically impossible (unless somebody has a
*lot* of time they want to donate).
This also reminds me of the issue (which I never found a nice answer for) that
there is no way to determine the length of the string returned from any of the
tvb_get_string functions. The length requested is unreliable because it may
change due to encodings, and strlen is unreliable because the string may
contain embedded NULLs.
You are receiving this mail because:
- You are watching all bug changes.