Wireshark-bugs: [Wireshark-bugs] [Bug 4992] Support to decode the Gearman protocol

Date: Mon, 12 Jul 2010 10:51:44 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4992

Gerald Combs <gerald@xxxxxxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gerald@xxxxxxxxxxxxx

--- Comment #8 from Gerald Combs <gerald@xxxxxxxxxxxxx> 2010-07-12 10:51:39 PDT ---
>          proto_tree_add_text(content_tree, tvb, start, len, "Minute: %s", tvb_get_ptr(tvb, start, len));

Don't do that. If the TVB doesn't contain a NULL you'll read past the end of
the buffer. Even if it does contain a NULL Wireshark will pass the raw bytes to
GTK+, which will pass them to Pango, which *really* wants to see a valid UTF-8
sequence, which may not be present in the TVB. Instead, do this:

    proto_tree_add_item(tree, hf_gearman_minutes, start, len, FALSE);

where hf_gearman_minutes is of type FT_STRING. Alternatively you could do this:

    proto_tree_add_text(tree, tvb, start, len, "%s", tvb_format_text(tvb,
        start, len));

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.