summaryrefslogtreecommitdiff
path: root/packet-rtcp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-01-10 22:21:14 +0000
committerGuy Harris <guy@alum.mit.edu>2002-01-10 22:21:14 +0000
commita4d560eb5b9bfa822097cbed09e3d30ed9f98263 (patch)
tree5b42fe7ea713ecdc56002bee7728d3045812b7da /packet-rtcp.c
parent43caedd1f99e2eebf61b8c0ce38c1deff02a124b (diff)
downloadwireshark-a4d560eb5b9bfa822097cbed09e3d30ed9f98263.tar.gz
From Nagarjuna Venna: only display the reason in BYE RTCP packets if
it's present. svn path=/trunk/; revision=4518
Diffstat (limited to 'packet-rtcp.c')
-rw-r--r--packet-rtcp.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/packet-rtcp.c b/packet-rtcp.c
index 1f8770e452..9062fb4ab4 100644
--- a/packet-rtcp.c
+++ b/packet-rtcp.c
@@ -1,6 +1,6 @@
/* packet-rtcp.c
*
- * $Id: packet-rtcp.c,v 1.27 2001/12/10 00:25:33 guy Exp $
+ * $Id: packet-rtcp.c,v 1.28 2002/01/10 22:21:13 guy Exp $
*
* Routines for RTCP dissection
* RTCP = Real-time Transport Control Protocol
@@ -386,18 +386,20 @@ dissect_rtcp_bye( tvbuff_t *tvb, int offset, frame_data *fd, proto_tree *tree,
offset += 4;
}
- /* Bye reason consists of an 8 bit length l and a string with length l */
- reason_length = tvb_get_guint8( tvb, offset );
- proto_tree_add_item( tree, hf_rtcp_ssrc_length, tvb, offset, 1, FALSE );
- offset++;
+ if ( tvb_reported_length_remaining( tvb, offset ) > 0 ) {
+ /* Bye reason consists of an 8 bit length l and a string with length l */
+ reason_length = tvb_get_guint8( tvb, offset );
+ proto_tree_add_item( tree, hf_rtcp_ssrc_length, tvb, offset, 1, FALSE );
+ offset++;
- reason_text = ( char* ) malloc( reason_length + 1 );
- for ( counter = 0; counter < reason_length; counter++ ) reason_text[ counter ] = tvb_get_guint8( tvb, offset + counter );
- /* strncpy( reason_text, pd + offset, reason_length ); */
- reason_text[ reason_length ] = '\0';
- proto_tree_add_string( tree, hf_rtcp_ssrc_text, tvb, offset, reason_length, reason_text );
- free( reason_text );
- offset += reason_length;
+ reason_text = ( char* ) malloc( reason_length + 1 );
+ for ( counter = 0; counter < reason_length; counter++ ) reason_text[ counter ] = tvb_get_guint8( tvb, offset + counter );
+ /* strncpy( reason_text, pd + offset, reason_length ); */
+ reason_text[ reason_length ] = '\0';
+ proto_tree_add_string( tree, hf_rtcp_ssrc_text, tvb, offset, reason_length, reason_text );
+ free( reason_text );
+ offset += reason_length;
+ }
return offset;