packet-xot.c: Handle potentially large representation of packet sizes
authorMichael Mann <mmann78@netscape.net>
Thu, 20 Apr 2017 02:51:45 +0000 (22:51 -0400)
committerJaap Keuter <jaap.keuter@xs4all.nl>
Thu, 20 Apr 2017 09:04:09 +0000 (09:04 +0000)
Value on wire is 2^x, so represent the field that way.

Bug: 13618
Change-Id: Ida4a85e1f52b29b8b89fa835f78ef3fff2bde5c9
Reviewed-on: https://code.wireshark.org/review/21237
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
epan/dissectors/packet-xot.c

index c38f82be0785cd39a513c8abae5cb5445c516beb..5539a8948b2aa648fa1a943e0929600dcfb1b4fa 100644 (file)
@@ -257,11 +257,11 @@ static int dissect_xot_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
          hdr_offset += 1;
          proto_tree_add_item(xot_tree, hf_xot_pvc_send_out_window, tvb, hdr_offset, 1, ENC_BIG_ENDIAN);
          hdr_offset += 1;
-         pkt_size = 1 << tvb_get_guint8(tvb, hdr_offset);
-         proto_tree_add_uint(xot_tree, hf_xot_pvc_send_inc_pkt_size, tvb, hdr_offset, 1, pkt_size);
+         pkt_size = tvb_get_guint8(tvb, hdr_offset);
+         proto_tree_add_uint_format_value(xot_tree, hf_xot_pvc_send_inc_pkt_size, tvb, hdr_offset, 1, pkt_size, "2^%u", pkt_size);
          hdr_offset += 1;
-         pkt_size = 1 << tvb_get_guint8(tvb, hdr_offset);
-         proto_tree_add_uint(xot_tree, hf_xot_pvc_send_out_pkt_size, tvb, hdr_offset, 1, pkt_size);
+         pkt_size = tvb_get_guint8(tvb, hdr_offset);
+         proto_tree_add_uint_format_value(xot_tree, hf_xot_pvc_send_out_pkt_size, tvb, hdr_offset, 1, pkt_size, "2^%u", pkt_size);
          hdr_offset += 1;
          proto_tree_add_item(xot_tree, hf_xot_pvc_init_itf_name, tvb, hdr_offset, init_itf_name_len, ENC_ASCII|ENC_NA);
          hdr_offset += init_itf_name_len;