Wireshark-bugs: [Wireshark-bugs] [Bug 8216] ASN.1 PER Encoding: UTF8String dissection
Comment # 16
on bug 8216
from Guy Harris
(In reply to comment #9)
> (In reply to comment #8)
> > OK, done. It does not link because it does not find function
> > proto_tree_add_unicode_string anywhere.
>
> Then I guess you are using 1.8 branch and not trunk (this function is only
> available in trunk).
No, it's also in the 1.8 branch.
However, it's not in the epan/libwireshark.def file, either on the 1.8 branch
*OR* in the trunk, so, on platforms where that file controls what functions are
exported from the libwireshark shared library, it's not available to plugins
(it *might* be available to builtins, if the file isn't processed until
libwireshark is built, as the builtins are part of the library and get to refer
to non-exported routines).
Windows is obviously one platform where that file controls what functions are
exported from the libwireshark shared library, but I think platforms using the
GNU linker, e.g. most Linux distributions, are other platforms where that
happens.
BTW:
1) that routine should really have been called proto_tree_add_utf8_string,
as that's the particular encoding of Unicode that it handles;
2) it's just
proto_item *
proto_tree_add_unicode_string(proto_tree *tree, int hfindex, tvbuff_t *tvb,
gint start,
gint length, const char* value)
{
DISSECTOR_ASSERT(g_utf8_validate(value, -1, NULL));
return proto_tree_add_string_format_value(tree, hfindex, tvb, start,
length, value, "%s", value);
}
I.e., it's like proto_tree_add_string_format_value(), except that it
reports a dissector bug if the string is not, in fact, valid UTF-8.
(That's not really the right thing to do; it's not necessarily a dissector bug,
it could be that whatever's sending the string didn't check the validity of the
string before sending it, so Wireshark should, when displaying purported UTF-8
strings, replace invalid UTF-8 sequences with something that's valid UTF-8 and
that somehow indicates that there's a problem with the string. That's a
separate matter, however.)
You are receiving this mail because:
- You are watching all bug changes.