diff options
-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 ); |