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>
This commit is contained in:
Dario Lombardo 2017-08-08 10:29:32 +02:00 committed by Alexis La Goutte
parent a8b018b71c
commit aae0f13b7e
1 changed files with 3 additions and 3 deletions

View File

@ -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 */