aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gsm_abis_oml.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-06-04 01:41:18 +0200
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-06-09 06:58:41 +0000
commite450911f4388781ae85da476bed55ecca54d89b8 (patch)
treea51437c6b07ee44e891858536fd6174e751b01c2 /epan/dissectors/packet-gsm_abis_oml.c
parent1689c1c6386c8f43d87c2c15504f24a2de7cfaa2 (diff)
GSM A-bis/OML: fix regression in dissect_oml_manuf()
In ca86d0ab38fdaed6ba2249bb976e73d02d903dc5 I introduced a regression that caused the A-bis/OML dissector to not recognize ip.access specific messages as such. The value returned by tvb_memeql() needs to be reverted, because it returns 0 on success, just like memcmp(). Additionally, I noticed that some implementations of the ip.access dialect do terminate the manufacturer ID string with a null character, while some do not. Handle both cases properly.
Diffstat (limited to 'epan/dissectors/packet-gsm_abis_oml.c')
-rw-r--r--epan/dissectors/packet-gsm_abis_oml.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/epan/dissectors/packet-gsm_abis_oml.c b/epan/dissectors/packet-gsm_abis_oml.c
index e51ed21560..8731921477 100644
--- a/epan/dissectors/packet-gsm_abis_oml.c
+++ b/epan/dissectors/packet-gsm_abis_oml.c
@@ -1954,9 +1954,10 @@ dissect_oml_manuf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(tree, hf_oml_manuf_id_val, tvb,
offset + 1, len, ENC_ASCII|ENC_NA);
- if (len == sizeof(ipaccess_magic) &&
- tvb_memeql(tvb, offset+1, ipaccess_magic, sizeof(ipaccess_magic))) {
- offset += (int)sizeof(ipaccess_magic) + 1;
+ /* Some implementations include '\0', some don't - handle this */
+ if ((len == (sizeof(ipaccess_magic) + 1) || len == sizeof(ipaccess_magic)) &&
+ !tvb_memeql(tvb, offset+1, ipaccess_magic, sizeof(ipaccess_magic))) {
+ offset += len + 1;
return dissect_oml_fom(tvb, pinfo, tree, offset, top_ti);
} else {
expert_add_info(pinfo, top_ti, &ei_unknown_manuf);