From 3b1511547ab48552d2da29b894ec5278249303af Mon Sep 17 00:00:00 2001 From: etxrab Date: Tue, 6 Dec 2011 19:10:13 +0000 Subject: Accpet lover case Topology descriptor (tp) as we accept other tokens in lowercase. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40104 f5534014-38df-0310-8fa8-9805f1628bb7 --- epan/dissectors/packet-megaco.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/epan/dissectors/packet-megaco.c b/epan/dissectors/packet-megaco.c index c171320dba..9205f2f696 100644 --- a/epan/dissectors/packet-megaco.c +++ b/epan/dissectors/packet-megaco.c @@ -881,7 +881,11 @@ nextcontext: tvb_next_offset = tvb_command_start_offset + tokenlen; /* Try to dissect Topology Descriptor before the command */ - if ( tvb_get_guint8(tvb, tvb_command_start_offset ) == 'T') { + tempchar = tvb_get_guint8(tvb, tvb_command_start_offset); + if ( (tempchar >= 'a')&& (tempchar <= 'z')){ + tempchar = tempchar - 0x20; + } + if ( tempchar == 'T') { tempchar = tvb_get_guint8(tvb, tvb_command_start_offset+1); if ( (tempchar >= 'a')&& (tempchar <= 'z')) @@ -954,6 +958,7 @@ nextcontext: if ( tempchar != 'E' ){ + /* Short form used */ if ( tvb_get_guint8(tvb, 0 ) == '!'){ switch ( tempchar ){ @@ -1122,12 +1127,17 @@ nextcontext: break; default: - tokenlen = (tvb_RBRKT+1) - tvb_previous_offset; - tvb_ensure_bytes_exist(tvb, tvb_previous_offset, tokenlen); - proto_tree_add_string(megaco_tree, hf_megaco_error_Frame, tvb, - tvb_previous_offset, tokenlen, - "No Command detectable !"); - return; + { + proto_item *item; + + tokenlen = (tvb_RBRKT+1) - tvb_previous_offset; + tvb_ensure_bytes_exist(tvb, tvb_previous_offset, tokenlen); + item = proto_tree_add_string(megaco_tree, hf_megaco_error_Frame, tvb, + tvb_previous_offset, tokenlen, + "No Command detectable !"); + proto_item_append_text(item,"[ tempchar 0x%x ]", tempchar); + return; + } } } else{ -- cgit v1.2.3