Wireshark-bugs: [Wireshark-bugs] [Bug 7715] Bluetooth: Add SAP dissector
Date: Mon, 24 Sep 2012 06:46:47 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7715

--- Comment #20 from Pascal Quantin <pascal.quantin@xxxxxxxxx> 2012-09-24 06:46:47 PDT ---
(In reply to comment #17)
> Comment on attachment 9215 [details]
> [PATCH] Bluetooth: Add colorfilter for SAP dissector
> 
> Committed revision 45098.

I fear this hunk will be problematic in osmocom mode (as offset has already
been incremented ):

+            length = tvb_len - 2;
+            if (length > 0) {
+                proto_tree_add_item(sim_tree, hf_apdu_data, tvb, offset,
length, ENC_NA);
+                offset += length;
+            }
+
+            /* obtain status word */
+            sw = tvb_get_ntohs(tvb, offset);
+            /* proto_tree_add_item(sim_tree, hf_apdu_sw, tvb, tvb_len-2, 2,
ENC_BIG_ENDIAN); */
+            proto_tree_add_uint_format(sim_tree, hf_apdu_sw, tvb, offset, 2,
sw,
+                                    "Status Word: %04x %s", sw,
get_sw_string(sw));

I guess it should be something like this instead, right?

+            length = tvb_len - 2;
+            if (!osmocom_mode && (length > 0)) {
+                proto_tree_add_item(sim_tree, hf_apdu_data, tvb, offset,
length, ENC_NA);
+                offset += length;
+            }
+
+            /* obtain status word */
+            sw = tvb_get_ntohs(tvb, length);
+            /* proto_tree_add_item(sim_tree, hf_apdu_sw, tvb, length, 2,
ENC_BIG_ENDIAN); */
+            proto_tree_add_uint_format(sim_tree, hf_apdu_sw, tvb, length, 2,
sw,
+                                    "Status Word: %04x %s", sw,
get_sw_string(sw));

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