aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mrcpv2.c
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2017-08-08 10:29:32 +0200
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2017-08-08 11:49:07 +0000
commitaae0f13b7e6223afe589e63e3fb77b8e95b00219 (patch)
tree4b336503b0497d3d53875d22530913f398b3118f /epan/dissectors/packet-mrcpv2.c
parenta8b018b71cf2732254f4f2512f03719d2686f7b3 (diff)
mrcpv2: fix bug in use of ws_strtou32.
Bug: 13952 Change-Id: I374343368c629b7f063c922f0aa8de32e21a95e8 Reviewed-on: https://code.wireshark.org/review/23012 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-mrcpv2.c')
-rw-r--r--epan/dissectors/packet-mrcpv2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-mrcpv2.c b/epan/dissectors/packet-mrcpv2.c
index 68ecca81f4..98a5437b59 100644
--- a/epan/dissectors/packet-mrcpv2.c
+++ b/epan/dissectors/packet-mrcpv2.c
@@ -1023,8 +1023,8 @@ dissect_mrcpv2_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
value_size = dot_offset - slash_offset - 1;
if ((value_size != 1) && (value_size != 2))
return 0;
- major = tvb_get_string_enc(wmem_packet_scope(), tvb, slash_offset + 1, dot_offset - 1, ENC_ASCII);
- if (ws_strtou32(major, NULL, &value) || value != 2)
+ major = tvb_get_string_enc(wmem_packet_scope(), tvb, slash_offset + 1, value_size, ENC_ASCII);
+ if (!ws_strtou32(major, NULL, &value) || value != 2)
return 0;
/* get second digit, it should be 0 */
@@ -1039,7 +1039,7 @@ dissect_mrcpv2_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
minor = tvb_get_string_enc(wmem_packet_scope(), tvb, dot_offset + 1, MRCPV2_MIN_LENGTH - sp_offset - 1, ENC_ASCII);
len = sp_offset;
}
- if (ws_strtou32(minor, NULL, &value) || value != 0)
+ if (!ws_strtou32(minor, NULL, &value) || value != 0)
return 0;
/* if we are here, then we have MRCP v 2.0 protocol, so proceed with the dissection */