From Martin Kaiser:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 29 May 2011 06:34:05 +0000 (06:34 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 29 May 2011 06:34:05 +0000 (06:34 +0000)
 checks the address of the Configuration
Option Register that is used for switching a PC-Card in DVB-CI mode.

The address must be <= 0xffe..

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5940

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37454 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-dvbci.c

index 8b8a53efefb772d20601680b3cb203414ae879bb..55f7a9f4a65cb8de1a93de1e00e71287b58afc35 100644 (file)
@@ -1413,6 +1413,7 @@ dissect_dvbci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     tvbuff_t *payload_tvb;
     guint16 cor_addr;
     guint8 cor_value;
+    proto_item *pi;
     guint8 hw_event;
 
     if (tvb_length(tvb) < 4)
@@ -1469,15 +1470,29 @@ dissect_dvbci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         /* I did not assign hf_... values for cor_addr and cor_value
            there's no need to filter against them */
         cor_addr = tvb_get_ntohs(tvb, offset);
-        proto_tree_add_text(dvbci_tree, tvb, offset, 2,
+        if (cor_addr == 0xffff) {
+            proto_tree_add_text(dvbci_tree, tvb, offset, 2,
+                "COR address is unknown");
+            col_append_sep_str(pinfo->cinfo, COL_INFO, ": ", "unknown address");
+        }
+        else if (cor_addr > 0xFFE) {
+            pi = proto_tree_add_text(tree, tvb, offset, 2, "Invalid COR address");
+            expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
+                "COR address must not be greater than 0xFFE (DVB-CI spec, A.5.6)");
+        }
+        else {
+            proto_tree_add_text(dvbci_tree, tvb, offset, 2,
                 "COR address: 0x%x", cor_addr);
+            col_append_sep_fstr(pinfo->cinfo, COL_INFO, ": ",
+                "address 0x%x", cor_addr);
+        }
         offset += 2;
         cor_value = tvb_get_guint8(tvb, offset);
         proto_tree_add_text(dvbci_tree, tvb, offset, 1,
                 "COR value: 0x%x", cor_value);
+        col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL,
+            "value 0x%x", cor_value);
         offset++;
-        col_append_sep_fstr(pinfo->cinfo, COL_INFO, ": ",
-                "address 0x%x, value 0x%x", cor_addr, cor_value);
     }
     else if (event==HW_EVT) {
         hw_event = tvb_get_guint8(tvb, offset);