Wireshark-dev: Re: [Wireshark-dev] Some apparent type bugs

From: Martin Mathieson <martin.r.mathieson@xxxxxxxxxxxxxx>
Date: Fri, 31 Jul 2020 12:58:56 +0100
I don't know how that type works, but in my script I used the current types tested in the switch or if statements in proto.c

So proto_tree_add_item_ret_uint() has:

switch (hfinfo->type) {
    case FT_CHAR:
    case FT_UINT8:
    case FT_UINT16:
    case FT_UINT24:
    case FT_UINT32:
        break;
    default:
    REPORT_DISSECTOR_BUG("field %s is not of type FT_CHAR, FT_UINT8, FT_UINT16, FT_UINT24, or FT_UINT32",
                                                  hfinfo->abbrev);
}

I am not able to push changes to gerrit at the moment, I did spot this copy/paste error:

diff --git a/epan/proto.c b/epan/proto.c
index 065b4b2c34..2f48344266 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -3156,7 +3156,7 @@ ptvcursor_add_ret_int(ptvcursor_t *ptvc, int hfindex, gint length,
        case FT_INT32:
                break;
        default:
-               REPORT_DISSECTOR_BUG("field %s is not of type FT_CHAR, FT_UINT8, FT_UINT16, FT_UINT24, or FT_UINT32",
+               REPORT_DISSECTOR_BUG("field %s is not of type FT_INT8, FT_INT16, FT_INT24, or FT_INT32",
                    hfinfo->abbrev);
        }  






On Fri, Jul 31, 2020 at 12:50 PM Jaap Keuter <jaap.keuter@xxxxxxxxx> wrote:
Hi,

Shouldn’t these be supported? After all, they have a UINT.

On 31 Jul 2020, at 11:28, Martin Mathieson via Wireshark-dev <wireshark-dev@xxxxxxxxxxxxx> wrote:

Error: proto_tree_add_item_ret_uint (.., hf_lcp_opt_id , ...) called at ./tools/../epan/dissectors/packet-ppp.c 2377 with type FT_UINT_BYTES
    (allowed types are {'FT_CHAR', 'FT_UINT32', 'FT_UINT24', 'FT_UINT16', 'FT_UINT8'} )

Error: proto_tree_add_item_ret_uint (.., hf_slsk_directory_name , ...) called at ./tools/../epan/dissectors/packet-slsk.c 1051 with type FT_UINT_STRING
    (allowed types are {'FT_CHAR', 'FT_UINT32', 'FT_UINT24', 'FT_UINT16', 'FT_UINT8'} )

Thanks,
Jaap

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe