aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/tcap/packet-tcap-template.c
diff options
context:
space:
mode:
Diffstat (limited to 'asn1/tcap/packet-tcap-template.c')
-rw-r--r--asn1/tcap/packet-tcap-template.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/asn1/tcap/packet-tcap-template.c b/asn1/tcap/packet-tcap-template.c
index 4ff4f1e963..0d44a86d52 100644
--- a/asn1/tcap/packet-tcap-template.c
+++ b/asn1/tcap/packet-tcap-template.c
@@ -36,6 +36,7 @@
#include <epan/oids.h>
#include <epan/emem.h>
#include <epan/asn1.h>
+#include <epan/strutil.h>
#include <stdio.h>
#include <string.h>
@@ -238,7 +239,7 @@ dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
if ( p_tcap_context && cur_oid && !p_tcap_context->oid_present ) {
/* Save the application context and the sub dissector */
ber_oid_dissector_table = find_dissector_table("ber.oid");
- strncpy(p_tcap_context->oid,cur_oid, LENGTH_OID);
+ g_strlcpy(p_tcap_context->oid,cur_oid, LENGTH_OID);
p_tcap_context->oid_present=TRUE;
if ( (subdissector_handle = dissector_get_string_handle(ber_oid_dissector_table, cur_oid)) ) {
p_tcap_context->subdissector_handle=subdissector_handle;
@@ -565,7 +566,7 @@ dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offs
/* ACN, changed, Fallback to lower version
* and update the subdissector (purely formal)
*/
- strncpy(p_tcap_context->oid,cur_oid, LENGTH_OID);
+ g_strlcpy(p_tcap_context->oid,cur_oid, LENGTH_OID);
if ( (subdissector_handle = dissector_get_string_handle(ber_oid_dissector_table, cur_oid)) ) {
p_tcap_context->subdissector_handle=subdissector_handle;
p_tcap_context->subdissector_present=TRUE;
@@ -573,7 +574,7 @@ dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offs
}
} else {
/* We do not have the OID in the TCAP context, so store it */
- strncpy(p_tcap_context->oid,cur_oid, LENGTH_OID);
+ g_strlcpy(p_tcap_context->oid,cur_oid, LENGTH_OID);
p_tcap_context->oid_present=TRUE;
/* Try to find a subdissector according to OID */
if ( (subdissector_handle