aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-t38.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-12-21 19:28:48 +0000
committerGuy Harris <guy@alum.mit.edu>2004-12-21 19:28:48 +0000
commit9461951d501e4f0996787c07a6074e7e0b889167 (patch)
tree3a8ae2be2cb82414b7301599cc8f8f5403eff751 /epan/dissectors/packet-t38.c
parent97755f83fc7a2901cac7a680d2eb90fd6fe88cdc (diff)
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
Diffstat (limited to 'epan/dissectors/packet-t38.c')
-rw-r--r--epan/dissectors/packet-t38.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/dissectors/packet-t38.c b/epan/dissectors/packet-t38.c
index 06327f5ce1..b7d05daa2a 100644
--- a/epan/dissectors/packet-t38.c
+++ b/epan/dissectors/packet-t38.c
@@ -233,7 +233,7 @@ void t38_add_address(packet_info *pinfo,
* Update the conversation data.
*/
strncpy(p_conv_data->method, setup_method, MAX_T38_SETUP_METHOD_SIZE);
- p_conv_data->method[MAX_T38_SETUP_METHOD_SIZE - 1] = '\0';
+ p_conv_data->method[MAX_T38_SETUP_METHOD_SIZE] = '\0';
p_conv_data->frame_number = setup_frame_number;
}