diff options
Diffstat (limited to 'contrib/bind9/lib/dns/name.c')
-rw-r--r-- | contrib/bind9/lib/dns/name.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/contrib/bind9/lib/dns/name.c b/contrib/bind9/lib/dns/name.c index f88f281b61886..23835138a7895 100644 --- a/contrib/bind9/lib/dns/name.c +++ b/contrib/bind9/lib/dns/name.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: name.c,v 1.174 2011-01-13 04:59:25 tbox Exp $ */ +/* $Id: name.c,v 1.174.8.1 2011-03-11 06:47:04 marka Exp $ */ /*! \file */ @@ -1024,12 +1024,13 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source, const dns_name_t *origin, unsigned int options, isc_buffer_t *target) { - unsigned char *ndata, *label; + unsigned char *ndata, *label = NULL; char *tdata; char c; ft_state state; - unsigned int value, count; - unsigned int n1, n2, tlen, nrem, nused, digits, labels, tused; + unsigned int value = 0, count = 0; + unsigned int n1 = 0, n2 = 0; + unsigned int tlen, nrem, nused, digits = 0, labels, tused; isc_boolean_t done; unsigned char *offsets; dns_offsets_t odata; @@ -1063,16 +1064,6 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source, offsets[0] = 0; /* - * Initialize things to make the compiler happy; they're not required. - */ - n1 = 0; - n2 = 0; - label = NULL; - digits = 0; - value = 0; - count = 0; - - /* * Make 'name' empty in case of failure. */ MAKE_EMPTY(name); @@ -1171,6 +1162,7 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source, return (DNS_R_BADLABELTYPE); } state = ft_escape; + POST(state); /* FALLTHROUGH */ case ft_escape: if (!isdigit(c & 0xff)) { @@ -1236,6 +1228,7 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source, label = origin->ndata; n1 = origin->length; nrem -= n1; + POST(nrem); while (n1 > 0) { n2 = *label++; INSIST(n2 <= 63); /* no bitstring support */ |