From 9461951d501e4f0996787c07a6074e7e0b889167 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 21 Dec 2004 19:28:48 +0000 Subject: Make the array for the "setup method" for RTP, RTCP, and T.38 conversations large enough to hold the maximum setup method size plus a trailing '\0'. Make the maximum setup method size 7, so that when the trailing '\0' is included the total array length is a power of 2. (The longest string currently used is "Skinny", which fits in 7 characters). This fixes problems in the RTP and RTCP dissectors similar to the one found in the T.38 dissector. Undo the previous change to packet-t38.c, as it's now safe to store in method[MAX_T38_SETUP_METHOD_SIZE], because the array now has MAX_T38_SETUP_METHOD_SIZE+1 characters. (Should we use "strlcpy()", and supply our own "strlcpy()" if the system and/or C library doesn't supply it? Its semantics are a bit cleaner than those of the "strncpy()"/null-terminate idiom, perhaps making it less likely that mistakes of this sort will be made.) svn path=/trunk/; revision=12803 --- epan/dissectors/packet-rtcp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'epan/dissectors/packet-rtcp.h') diff --git a/epan/dissectors/packet-rtcp.h b/epan/dissectors/packet-rtcp.h index 096d24b39a..3cddf39ae2 100644 --- a/epan/dissectors/packet-rtcp.h +++ b/epan/dissectors/packet-rtcp.h @@ -30,12 +30,12 @@ /* Info to save in RTCP conversation / packet-info. Note that this structure applies to the destination end of an RTP session */ -#define MAX_RTCP_SETUP_METHOD_SIZE 8 +#define MAX_RTCP_SETUP_METHOD_SIZE 7 struct _rtcp_conversation_info { /* Setup info is relevant to traffic whose dest is the conversation address */ guchar setup_method_set; - gchar setup_method[MAX_RTCP_SETUP_METHOD_SIZE]; + gchar setup_method[MAX_RTCP_SETUP_METHOD_SIZE + 1]; guint32 setup_frame_number; /* Info used for roundtrip calculations */ -- cgit v1.2.3