diff options
Diffstat (limited to 'lib/dns/name.c')
| -rw-r--r-- | lib/dns/name.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/lib/dns/name.c b/lib/dns/name.c index 80864b8b9160..f2c78905a274 100644 --- a/lib/dns/name.c +++ b/lib/dns/name.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2008, 2010 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008, 2010, 2011 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: name.c,v 1.165.120.3 2010-07-09 05:15:05 each Exp $ */ +/* $Id: name.c,v 1.165.120.5 2011-03-12 04:57:27 tbox Exp $ */ /*! \file */ @@ -1024,12 +1024,13 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source, 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 */ |
