diff options
author | Marius Paliga <marius.paliga@gmail.com> | 2017-08-01 10:52:54 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2017-08-01 11:55:17 +0000 |
commit | 6893f7a5c7d223e9e3ef9966ce9757588196c66a (patch) | |
tree | b8c14bee6c68b1bdc1b156bf3af9858b7801a7dd /epan | |
parent | 4e9085696b0a0354b4ece9aa32230952608b3fa4 (diff) |
E212: Check MNC length before trying 3-digits length
Bug: 13935
Change-Id: Ib3f86c7a70d065cf7d5659a2fbc9c34047efcb56
Reviewed-on: https://code.wireshark.org/review/22894
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-e212.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/epan/dissectors/packet-e212.c b/epan/dissectors/packet-e212.c index 7ec88914cc..347e6c3211 100644 --- a/epan/dissectors/packet-e212.c +++ b/epan/dissectors/packet-e212.c @@ -3262,9 +3262,11 @@ dissect_e212_mcc_mnc_in_utf8_address(tvbuff_t *tvb, packet_info *pinfo _U_, prot /* Try to match the MCC and 2 digits MNC with an entry in our list of operators */ if (!try_val_to_str_ext(mcc * 100 + mnc, &mcc_mnc_2digits_codes_ext)) { - ws_strtou16(tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 3, 3, ENC_UTF_8), - NULL, &mnc); - long_mnc = TRUE; + if (tvb_reported_length_remaining(tvb, offset + 3) > 2) { + ws_strtou16(tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 3, 3, ENC_UTF_8), + NULL, &mnc); + long_mnc = TRUE; + } } proto_tree_add_uint(tree, hf_E212_mcc, tvb, offset, 3, mcc ); |