aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mgcp.c
diff options
context:
space:
mode:
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2008-03-01 17:23:39 +0000
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2008-03-01 17:23:39 +0000
commit994d316315868546fa15319311187414c3b4d4f9 (patch)
tree75b52bc6b03f8df488b8acbe97063df9d6d8b02d /epan/dissectors/packet-mgcp.c
parentbb42d82ed760cb028118fca73c79f37e1cbc00b6 (diff)
Rewrote to use g_strlcpy and g_strlcat.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24525 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-mgcp.c')
-rw-r--r--epan/dissectors/packet-mgcp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-mgcp.c b/epan/dissectors/packet-mgcp.c
index 445c5524e0..1a6539cec8 100644
--- a/epan/dissectors/packet-mgcp.c
+++ b/epan/dissectors/packet-mgcp.c
@@ -45,6 +45,7 @@
#include <epan/prefs.h>
#include <epan/conversation.h>
#include <epan/tap.h>
+#include <epan/strutil.h>
#include "packet-mgcp.h"
#ifdef NEED_G_ASCII_STRCASECMP_H
@@ -1451,8 +1452,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
if (tokenlen > 4)
THROW(ReportedBoundsError);
code = tvb_format_text(tvb,tvb_previous_offset,tokenlen);
- strncpy(mi->code,code,4);
- mi->code[4] = '\0';
+ g_strlcpy(mi->code,code,5);
if (is_mgcp_verb(tvb,tvb_previous_offset,tvb_current_len,&verb_description))
{
mgcp_type = MGCP_REQUEST;
@@ -1597,7 +1597,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
mi->request_available = TRUE;
mgcp_call->responded = TRUE;
mi->req_num = mgcp_call->req_num;
- strncpy(mi->code,mgcp_call->code,5);
+ g_strlcpy(mi->code,mgcp_call->code,5);
item = proto_tree_add_uint_format(tree, hf_mgcp_req_frame,
tvb, 0, 0, mgcp_call->req_num,
"This is a response to a request in frame %u",
@@ -1751,7 +1751,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
mgcp_call->transid = mi->transid;
mgcp_call->responded = FALSE;
mgcp_call->req_time=pinfo->fd->abs_ts;
- strncpy(mgcp_call->code,mi->code,5);
+ g_strlcpy(mgcp_call->code,mi->code,5);
/* Store it */
g_hash_table_insert(mgcp_calls, new_mgcp_call_key, mgcp_call);