aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-clnp.c6
-rw-r--r--epan/dissectors/packet-cops.c10
-rw-r--r--epan/dissectors/packet-diameter.c2
-rw-r--r--epan/dissectors/packet-dns.c2
-rw-r--r--epan/dissectors/packet-fcdns.c2
-rw-r--r--epan/dissectors/packet-fcswils.c4
-rw-r--r--epan/dissectors/packet-fddi.c14
-rw-r--r--epan/dissectors/packet-fw1.c2
-rw-r--r--epan/dissectors/packet-h245.c2
-rw-r--r--epan/dissectors/packet-iax2.c3
-rw-r--r--epan/dissectors/packet-icep.c4
11 files changed, 25 insertions, 26 deletions
diff --git a/epan/dissectors/packet-clnp.c b/epan/dissectors/packet-clnp.c
index 117e9d0fa5..083c06ae50 100644
--- a/epan/dissectors/packet-clnp.c
+++ b/epan/dissectors/packet-clnp.c
@@ -416,16 +416,16 @@ static gchar *print_tsap(const guchar *tsap, int length)
cur=ep_alloc(MAX_TSAP_LEN * 2 + 3);
cur[0] = '\0';
if (length <= 0 || length > MAX_TSAP_LEN)
- sprintf(cur, "<unsupported TSAP length>");
+ g_snprintf(cur, MAX_TSAP_LEN * 2 + 3, "<unsupported TSAP length>");
else {
allprintable = is_all_printable(tsap,length);
if (!allprintable)
strcat(cur,"0x");
while (length != 0) {
if (allprintable)
- sprintf(tmp, "%c", *tsap ++);
+ g_snprintf(tmp, sizeof(tmp), "%c", *tsap ++);
else
- sprintf(tmp, "%02x", *tsap ++);
+ g_snprintf(tmp, sizeof(tmp), "%02x", *tsap ++);
strcat(cur, tmp);
length --;
}
diff --git a/epan/dissectors/packet-cops.c b/epan/dissectors/packet-cops.c
index bfb9d4f70f..b4b320a739 100644
--- a/epan/dissectors/packet-cops.c
+++ b/epan/dissectors/packet-cops.c
@@ -1309,7 +1309,7 @@ static guchar*format_asn_value (struct variable_list *variable, subid_t *variabl
variable->type=mib_to_asn_type(subtree->type);
if (!sprint_realloc_by_type(&buf, &buf_len, &out_len, TRUE, variable, subtree->enums, subtree->hint, NULL))
- sprintf(buf,"%s","sprint_realloc_by_type failed");
+ g_snprintf(buf,SPRINT_MAX_LEN,"%s","sprint_realloc_by_type failed");
return buf;
}
@@ -1486,8 +1486,8 @@ static int decode_cops_pr_asn1_data(tvbuff_t *tvb, guint32 offset,
* to the end of the string.
*/
vb_display_string = g_malloc(4*vb_length);
- buf = &vb_display_string[0];
- len = sprintf(buf, "%03u", vb_octet_string[0]);
+ buf = vb_display_string;
+ len = g_snprintf(buf, 4*vb_length, "%03u", vb_octet_string[0]);
buf += len;
for (i = 1; i < vb_length; i++) {
len = sprintf(buf, ".%03u", vb_octet_string[i]);
@@ -2657,7 +2657,7 @@ cops_transaction_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *st, guint8 op
val_to_str(code16,table_cops_dqos_transaction_id, "Unknown (0x%04x)"),code16);
/* Write the right data into the 'info field' on the Gui */
- sprintf(info,"COPS %-20s - ",val_to_str(op_code,cops_op_code_vals, "Unknown"));
+ g_snprintf(info,sizeof(info),"COPS %-20s - ",val_to_str(op_code,cops_op_code_vals, "Unknown"));
strcat(info,val_to_str(code16,table_cops_dqos_transaction_id, "Unknown"));
if (check_col(pinfo->cinfo, COL_INFO)) {
@@ -3053,7 +3053,7 @@ cops_mm_transaction_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *st, guint8
val_to_str(code16,table_cops_mm_transaction_id, "Unknown (0x%04x)"),code16);
/* Write the right data into the 'info field' on the Gui */
- sprintf(info,"COPS %-20s - ",val_to_str(op_code,cops_op_code_vals, "Unknown"));
+ g_snprintf(info,sizeof(info),"COPS %-20s - ",val_to_str(op_code,cops_op_code_vals, "Unknown"));
strcat(info,val_to_str(code16,table_cops_mm_transaction_id, "Unknown"));
if (check_col(pinfo->cinfo, COL_INFO)) {
diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c
index 0853412b8e..5e83b1fbde 100644
--- a/epan/dissectors/packet-diameter.c
+++ b/epan/dissectors/packet-diameter.c
@@ -1069,7 +1069,7 @@ diameter_avp_get_name(guint32 avpCode, guint32 vendorId)
avpCode, vendorId);
/* If we don't find it, build a name string */
- sprintf(buffer, "Unknown AVP:0x%08x", avpCode);
+ g_snprintf(buffer, sizeof(buffer), "Unknown AVP:0x%08x", avpCode);
return buffer;
} /* diameter_avp_get_name */
static const gchar *
diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c
index 8975520ec0..52c12253a9 100644
--- a/epan/dissectors/packet-dns.c
+++ b/epan/dissectors/packet-dns.c
@@ -734,7 +734,7 @@ rfc1867_angle(tvbuff_t *tvb, int offset, const char *nsew)
angle = angle / 60;
minutes = angle % 60;
degrees = angle / 60;
- sprintf(buf, "%u deg %u min %u.%03u sec %c", degrees, minutes, secs,
+ g_snprintf(buf, sizeof(buf), "%u deg %u min %u.%03u sec %c", degrees, minutes, secs,
tsecs, direction);
return buf;
}
diff --git a/epan/dissectors/packet-fcdns.c b/epan/dissectors/packet-fcdns.c
index 79b244ec47..89ea6901fa 100644
--- a/epan/dissectors/packet-fcdns.c
+++ b/epan/dissectors/packet-fcdns.c
@@ -1151,7 +1151,7 @@ dissect_fcdns_zone_mbr (tvbuff_t *tvb, proto_tree *zmbr_tree, int offset)
8)));
break;
case FC_SWILS_ZONEMBR_DP:
- sprintf(dpbuf, "0x%08x", tvb_get_ntohl (tvb, offset+4));
+ g_snprintf(dpbuf, sizeof(dpbuf), "0x%08x", tvb_get_ntohl (tvb, offset+4));
proto_tree_add_string (zmbr_tree, hf_fcdns_zone_mbrid, tvb,
offset+4, 4, dpbuf);
break;
diff --git a/epan/dissectors/packet-fcswils.c b/epan/dissectors/packet-fcswils.c
index 064921595a..8b0f5e7929 100644
--- a/epan/dissectors/packet-fcswils.c
+++ b/epan/dissectors/packet-fcswils.c
@@ -1009,7 +1009,7 @@ dissect_swils_zone_mbr (tvbuff_t *tvb, proto_tree *zmbr_tree, int offset)
8)));
break;
case FC_SWILS_ZONEMBR_DP:
- sprintf(dpbuf, "0x%08x", tvb_get_ntohl (tvb, offset+4));
+ g_snprintf(dpbuf, sizeof(dpbuf), "0x%08x", tvb_get_ntohl (tvb, offset+4));
proto_tree_add_string (zmbr_tree, hf_swils_zone_mbrid, tvb,
offset+4, 4, dpbuf);
break;
@@ -1035,7 +1035,7 @@ dissect_swils_zone_mbr (tvbuff_t *tvb, proto_tree *zmbr_tree, int offset)
offset+12, 8, 0);
break;
case FC_SWILS_ZONEMBR_DP_LUN:
- sprintf(dpbuf, "0x%08x", tvb_get_ntohl (tvb, offset+4));
+ g_snprintf(dpbuf, sizeof(dpbuf), "0x%08x", tvb_get_ntohl (tvb, offset+4));
proto_tree_add_string (zmbr_tree, hf_swils_zone_mbrid, tvb,
offset+4, 4, dpbuf);
proto_tree_add_item (zmbr_tree, hf_swils_zone_mbrid_lun, tvb,
diff --git a/epan/dissectors/packet-fddi.c b/epan/dissectors/packet-fddi.c
index 31ae210826..299ccbf899 100644
--- a/epan/dissectors/packet-fddi.c
+++ b/epan/dissectors/packet-fddi.c
@@ -219,35 +219,35 @@ fddifc_to_str(int fc)
switch (fc & FDDI_FC_CLFF) {
case FDDI_FC_MAC:
- sprintf(strbuf, "MAC frame, control %x", fc & FDDI_FC_ZZZZ);
+ g_snprintf(strbuf, sizeof(strbuf), "MAC frame, control %x", fc & FDDI_FC_ZZZZ);
return strbuf;
case FDDI_FC_SMT:
- sprintf(strbuf, "SMT frame, control %x", fc & FDDI_FC_ZZZZ);
+ g_snprintf(strbuf, sizeof(strbuf), "SMT frame, control %x", fc & FDDI_FC_ZZZZ);
return strbuf;
case FDDI_FC_LLC_ASYNC:
if (fc & FDDI_FC_ASYNC_R)
- sprintf(strbuf, "Async LLC frame, control %x", fc & FDDI_FC_ZZZZ);
+ g_snprintf(strbuf, sizeof(strbuf), "Async LLC frame, control %x", fc & FDDI_FC_ZZZZ);
else
- sprintf(strbuf, "Async LLC frame, priority %d",
+ g_snprintf(strbuf, sizeof(strbuf), "Async LLC frame, priority %d",
fc & FDDI_FC_ASYNC_PRI);
return strbuf;
case FDDI_FC_LLC_SYNC:
if (fc & FDDI_FC_ZZZZ) {
- sprintf(strbuf, "Sync LLC frame, control %x", fc & FDDI_FC_ZZZZ);
+ g_snprintf(strbuf, sizeof(strbuf), "Sync LLC frame, control %x", fc & FDDI_FC_ZZZZ);
return strbuf;
} else
return "Sync LLC frame";
case FDDI_FC_IMP_ASYNC:
- sprintf(strbuf, "Implementor async frame, control %x",
+ g_snprintf(strbuf, sizeof(strbuf), "Implementor async frame, control %x",
fc & FDDI_FC_ZZZZ);
return strbuf;
case FDDI_FC_IMP_SYNC:
- sprintf(strbuf, "Implementor sync frame, control %x",
+ g_snprintf(strbuf, sizeof(strbuf), "Implementor sync frame, control %x",
fc & FDDI_FC_ZZZZ);
return strbuf;
break;
diff --git a/epan/dissectors/packet-fw1.c b/epan/dissectors/packet-fw1.c
index e1c9ca15cb..08e8189ee0 100644
--- a/epan/dissectors/packet-fw1.c
+++ b/epan/dissectors/packet-fw1.c
@@ -151,7 +151,7 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_clear(pinfo->cinfo, COL_INFO);
- /* sprintf(header, fw1_header); */
+ /* g_snprintf(header, sizeof(header), fw1_header); */
/* fetch info to local variable */
direction = tvb_get_guint8(tvb, 0);
diff --git a/epan/dissectors/packet-h245.c b/epan/dissectors/packet-h245.c
index 411da62976..9a5772a0a5 100644
--- a/epan/dissectors/packet-h245.c
+++ b/epan/dissectors/packet-h245.c
@@ -22837,6 +22837,6 @@ static void reset_h245_packet_info(h245_packet_info *pi)
pi->msg_type = H245_OTHER;
pi->frame_label[0] = '\0';
- sprintf(pi->comment, "H245 ");
+ g_snprintf(pi->comment, sizeof(pi->comment), "H245 ");
}
diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c
index b8e83aa002..3efba06205 100644
--- a/epan/dissectors/packet-iax2.c
+++ b/epan/dissectors/packet-iax2.c
@@ -414,7 +414,8 @@ static gchar *key_to_str( const iax_circuit_key *key )
/* why doesn't address_to_str take a const pointer?
cast the warnings into oblivion. */
- sprintf(strp,"{%s:%i,%i}",
+ /* XXX - is this a case for ep_alloc? */
+ g_snprintf(strp, 80, "{%s:%i,%i}",
address_to_str((address *)&key->addr),
key->port,
key->callno);
diff --git a/epan/dissectors/packet-icep.c b/epan/dissectors/packet-icep.c
index 87838fdd28..9e1f13709e 100644
--- a/epan/dissectors/packet-icep.c
+++ b/epan/dissectors/packet-icep.c
@@ -327,9 +327,7 @@ static void dissect_ice_facet(proto_tree *tree, int hf_icep,
if ( Size == 0 ) {
if (tree) {
- s = ep_alloc( strlen("(empty)") + 1 );
- sprintf(s, "(empty)");
- s[strlen("(empty)")] = '\0';
+ s = ep_strdup( "(empty)" );
/* display the 0x00 Size byte when click on a empty ice_string */
proto_tree_add_string(tree, hf_icep, tvb, offset - 1, 1, s);
}