GSM: add a sanity check

Like the one added in gcfc47c1

Change-Id: Ieb6aaa406ad141502980d4447d5ee9f03044acbe
Reviewed-on: https://code.wireshark.org/review/14930
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>
This commit is contained in:
Pascal Quantin 2016-04-15 20:19:45 +02:00
parent 4400dcfdd2
commit 3ee37d7629
1 changed files with 3 additions and 0 deletions

View File

@ -2173,6 +2173,9 @@ de_mid(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guin
proto_tree_add_item(tree, hf_gsm_a_odd_even_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_gsm_a_mobile_identity_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
if (curr_offset - offset >= len) /* Sanity check */
return (curr_offset - offset);
if((oct & 0x07) == 3){
/* imeisv */
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb ,curr_offset , len - (curr_offset - offset), NULL, TRUE);