diff options
author | Balint Reczey <balint.reczey@ericsson.com> | 2008-12-30 10:25:05 +0000 |
---|---|---|
committer | Balint Reczey <balint.reczey@ericsson.com> | 2008-12-30 10:25:05 +0000 |
commit | 824e42a248d7bd8b6bdbda1225d189f2abf2472f (patch) | |
tree | 4de7045129f9b0986a0fbbf8bfa669582b0229d0 /epan/dissectors/packet-megaco.c | |
parent | 8d65f94d65e2cfffe49ebfae27158c2573c8c4cd (diff) |
Fixed topology descriptor dissection.
svn path=/trunk/; revision=27129
Diffstat (limited to 'epan/dissectors/packet-megaco.c')
-rw-r--r-- | epan/dissectors/packet-megaco.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/epan/dissectors/packet-megaco.c b/epan/dissectors/packet-megaco.c index c46b1f41bb..9d74674662 100644 --- a/epan/dissectors/packet-megaco.c +++ b/epan/dissectors/packet-megaco.c @@ -889,13 +889,21 @@ nextcontext: tempchar = tempchar - 0x20; if ( tempchar == 'P' || tempchar == 'O'){ - tvb_command_end_offset = tvb_find_guint8(tvb, tvb_command_start_offset, tvb_len, '}'); + gint tvb_topology_end_offset = tvb_find_guint8(tvb, tvb_command_start_offset, tvb_len, '}'); + if ( tvb_topology_end_offset == -1 ){ + proto_tree_add_text(megaco_tree, tvb, 0, 0, "[ Parse error: Missing \"}\" ]"); + return; + } + tvb_command_start_offset = tvb_find_guint8(tvb, tvb_command_start_offset, tvb_len, '{'); - dissect_megaco_topologydescriptor(tvb, megaco_tree_command_line, tvb_command_end_offset-1, tvb_command_start_offset+1); - tvb_next_offset = tvb_command_end_offset; + if ( tvb_command_start_offset == -1 ){ + proto_tree_add_text(megaco_tree, tvb, 0, 0, "[ Parse error: Missing \"{\" ]"); + return; + } + dissect_megaco_topologydescriptor(tvb, megaco_tree_command_line, tvb_topology_end_offset-1, tvb_command_start_offset+1); /* Command after Topology Descriptor */ - tvb_command_start_offset = tvb_find_guint8(tvb, tvb_command_end_offset +1, + tvb_command_start_offset = tvb_find_guint8(tvb, tvb_topology_end_offset + 1, tvb_len, ','); if ( tvb_command_start_offset == -1 ){ @@ -905,6 +913,7 @@ nextcontext: } else { /* Try to find the first char of the command */ tvb_command_start_offset = megaco_tvb_skip_wsp_return(tvb, tvb_command_start_offset + 1); + tvb_next_offset = tvb_find_guint8(tvb, tvb_command_start_offset, tvb_len, '{'); } |