diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2012-03-18 14:05:45 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2012-03-18 14:05:45 +0000 |
commit | 4906ffcdfe3be87bf1711dae5967cf9fbe02fd0f (patch) | |
tree | d5150461e42f28ce1458bc52386691cd4a27b103 /epan/dissectors/packet-ua3g.c | |
parent | c49205ed0f10ca61c620cda87e2de4446423a25c (diff) |
Fix the infinite-loop fuzz failure reported in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6962 :
Repeat r41359 in another location:
Don't try to display tone entries if there are none (but there is length for
them). Could/should be an expert_info.
Also fix a typo: Nomber->Number.
svn path=/trunk/; revision=41639
Diffstat (limited to 'epan/dissectors/packet-ua3g.c')
-rw-r--r-- | epan/dissectors/packet-ua3g.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ua3g.c b/epan/dissectors/packet-ua3g.c index 655e33d8da..5b102affdf 100644 --- a/epan/dissectors/packet-ua3g.c +++ b/epan/dissectors/packet-ua3g.c @@ -1145,11 +1145,11 @@ decode_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo tone_nb_entries = tvb_get_guint8(tvb, offset); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Nomber Of Entries: %d", tone_nb_entries); + proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Number Of Entries: %d", tone_nb_entries); offset++; length--; - while(length > 0) { + while(length > 0 && tone_nb_entries) { for(i = 1; i <= tone_nb_entries; i++) { frequency_1 = tvb_get_ntohs(tvb, offset); level_1 = (signed char)(tvb_get_guint8(tvb, offset + 2)) / 2; @@ -1197,7 +1197,7 @@ decode_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo tone_nb_entries = tvb_get_guint8(tvb, offset); proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Direction: %s - Nomber Of Entries: %d", + "Direction: %s - Number Of Entries: %d", val_to_str(tone_direction, str_tone_direction, "Unknown"), tone_nb_entries); offset++; length--; |