Another check/expert error for RARs.
authormartinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 30 Apr 2009 13:18:56 +0000 (13:18 +0000)
committermartinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 30 Apr 2009 13:18:56 +0000 (13:18 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28198 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-mac-lte.c

index cf972577c7ce5b4de7372a8c98150e1400aeff22..af0e959d20eaa01f29d4b03fccb597173ca4f920 100644 (file)
@@ -413,7 +413,6 @@ static gint dissect_rar_entry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
         /* Create subtree for UL grant break-down */
         proto_tree *ul_grant_tree = proto_item_add_subtree(ul_grant_ti, ett_mac_lte_rar_ul_grant);
 
-
         /* Hopping flag (1 bit) */
         proto_tree_add_item(ul_grant_tree, hf_mac_lte_rar_ul_grant_hopping,
                             tvb, offset, 1, FALSE);
@@ -575,6 +574,13 @@ static void dissect_rar(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
 
     /* Update TAP info */
     tap_info->number_of_rars += number_of_rars;
+
+    /* Warn if we don't seem to have reached the end of the frame yet */
+    if (tvb_length_remaining(tvb, offset) != 0) {
+           expert_add_info_format(pinfo, rar_headers_ti, PI_MALFORMED, PI_ERROR,
+                                  "%u bytes remaining after RAR PDU dissected",
+                                  tvb_length_remaining(tvb, offset));
+    }
 }
 
 
@@ -1471,7 +1477,7 @@ void proto_register_mac_lte(void)
         },
         { &hf_mac_lte_rar_rapid,
             { "RAPID",
-              "mac-lte.rar.rapid", FT_UINT8, BASE_HEX, 0, 0x3f,
+              "mac-lte.rar.rapid", FT_UINT8, BASE_HEX_DEC, 0, 0x3f,
               "Random Access Preamble IDentifier", HFILL
             }
         },