diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-10-08 12:31:06 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-10-08 12:31:06 +0000 |
commit | bc655dfba332e326f98b100b683babe644ce64cc (patch) | |
tree | 4cfddce6c9afc0c5173c2a10448a5896d1be1e9b /epan/dissectors/packet-bootp.c | |
parent | 8cafb43bddcd919dcdf92f05eccdb5a3f24d8db2 (diff) |
improve get_dns_name now that we have cheap emem allocated buffers
and get rid of a few strcpy()
a whole lot of arrays from the stack
and make the function prototype slightly nicer.
svn path=/trunk/; revision=16166
Diffstat (limited to 'epan/dissectors/packet-bootp.c')
-rw-r--r-- | epan/dissectors/packet-bootp.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/epan/dissectors/packet-bootp.c b/epan/dissectors/packet-bootp.c index c2ed87f28e..5625ced343 100644 --- a/epan/dissectors/packet-bootp.c +++ b/epan/dissectors/packet-bootp.c @@ -2495,7 +2495,7 @@ dissect_packetcable_ietf_ccc(proto_tree *v_tree, tvbuff_t *tvb, int optoff, proto_tree *pkt_s_tree; proto_item *vti; int max_timer_val = 255, i; - char dns_name[255], bit_fld[24]; + char *dns_name, bit_fld[24]; subopt = tvb_get_guint8(tvb, suboptoff); suboptoff++; @@ -2541,8 +2541,7 @@ dissect_packetcable_ietf_ccc(proto_tree *v_tree, tvbuff_t *tvb, int optoff, switch (prov_type) { case 0: /* XXX - check suboption length */ - get_dns_name(tvb, suboptoff, suboptoff, dns_name, - sizeof(dns_name)); + get_dns_name(tvb, suboptoff, suboptoff, &dns_name); proto_item_append_text(vti, "%s (%u byte%s)", dns_name, subopt_len - 1, plurality(subopt_len, "", "s") ); break; @@ -2614,7 +2613,7 @@ dissect_packetcable_ietf_ccc(proto_tree *v_tree, tvbuff_t *tvb, int optoff, case PKT_CCC_KRB_REALM: /* String values */ /* XXX - check suboption length */ - get_dns_name(tvb, suboptoff, suboptoff, dns_name, sizeof(dns_name)); + get_dns_name(tvb, suboptoff, suboptoff, &dns_name); proto_item_append_text(vti, "%s (%u byte%s)", dns_name, subopt_len, plurality(subopt_len, "", "s") ); suboptoff += subopt_len; |