diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2008-02-02 17:25:40 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2008-02-02 17:25:40 +0000 |
commit | 677eb18d202d100871dd6b08a18db9dba314ed3b (patch) | |
tree | be5bef5296434902f49f006f350c91544fdda44d /asn1/ansi_map/packet-ansi_map-template.c | |
parent | f4871e6269b60873a2a82db5f8c88ef8228d9c1b (diff) |
Rewrote some prohibited APIs in epan/dissectors/ (sprintf, strcpy, strcat).
If we get some truncated strings we probably overwrote some buffers...
svn path=/trunk/; revision=24249
Diffstat (limited to 'asn1/ansi_map/packet-ansi_map-template.c')
-rw-r--r-- | asn1/ansi_map/packet-ansi_map-template.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/asn1/ansi_map/packet-ansi_map-template.c b/asn1/ansi_map/packet-ansi_map-template.c index 73ce8852af..81fd108743 100644 --- a/asn1/ansi_map/packet-ansi_map-template.c +++ b/asn1/ansi_map/packet-ansi_map-template.c @@ -437,11 +437,8 @@ update_saved_invokedata(packet_info *pinfo, proto_tree *tree _U_, tvbuff_t *tvb p_private_tcap=pinfo->private_data; if ((!pinfo->fd->flags.visited)&&(p_private_tcap->TransactionID_str)){ /* Only do this once XXX I hope its the right thing to do */ - strcpy(buf,p_private_tcap->TransactionID_str); /* The hash string needs to contain src and dest to distiguish differnt flows */ - strcat(buf,src_str); - strcat(buf,dst_str); - strcat(buf,"\0"); + g_snprintf(buf,1024,"%s%s%s",p_private_tcap->TransactionID_str,src_str,dst_str); /* If the entry allready exists don't owervrite it */ ansi_map_saved_invokedata = g_hash_table_lookup(TransactionId_table,buf); if(ansi_map_saved_invokedata) @@ -4265,11 +4262,8 @@ find_saved_invokedata(asn1_ctx_t *actx){ /* The hash string needs to contain src and dest to distiguish differnt flows */ src_str = address_to_str(src); dst_str = address_to_str(dst); - strcpy(buf, p_private_tcap->TransactionID_str); /* Reverse order to invoke */ - strcat(buf,dst_str); - strcat(buf,src_str); - strcat(buf,"\0"); + g_snprintf(buf,1024,"%s%s%s",p_private_tcap->TransactionID_str,dst_str,src_str); /* g_warning("Find Hash string %s",buf); */ |