diff options
author | David Hankins <dhankins@isc.org> | 2008-03-06 21:33:22 +0000 |
---|---|---|
committer | David Hankins <dhankins@isc.org> | 2008-03-06 21:33:22 +0000 |
commit | 8269561daa68024749ab4c46684ef080884754ba (patch) | |
tree | 1554191bc87c25003f40ea6190bf6139427ab583 /common | |
parent | 27905a7d5e66dacacdde08b9989d270d59acfd75 (diff) | |
download | isc-dhcp-8269561daa68024749ab4c46684ef080884754ba.tar.gz |
- A bug was fixed where the length of a hostname was miscalculated, so that
hosts were given odd-looking domain names ("foo.bar.ba.example.com").
[ISC-Bugs #17732]
Diffstat (limited to 'common')
-rw-r--r-- | common/options.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/common/options.c b/common/options.c index e259cf7a..72b05863 100644 --- a/common/options.c +++ b/common/options.c @@ -3363,14 +3363,16 @@ fqdn6_universe_decode(struct option_state *options, /* Save the domain name. */ if (len > 0) { + unsigned char *fqdn_start = bp->data + 3; + if (!save_option_buffer(&fqdn_universe, options, bp, - bp->data + 3, len, FQDN_FQDN, 1)) + fqdn_start, len, FQDN_FQDN, 1)) goto error; - first_dot = (unsigned char *)strchr((char *)bp->data + 3, '.'); + first_dot = (unsigned char *)strchr((char *)fqdn_start, '.'); if (first_dot != NULL) { - hlen = first_dot - bp->data + 3; + hlen = first_dot - fqdn_start; dlen = len - hlen; } else { hlen = len; @@ -3378,14 +3380,14 @@ fqdn6_universe_decode(struct option_state *options, } if (!save_option_buffer(&fqdn_universe, options, bp, - bp->data + 3, len, FQDN_FQDN, 1) || + fqdn_start, len, FQDN_FQDN, 1) || ((hlen > 0) && !save_option_buffer(&fqdn_universe, options, bp, - bp->data + 3, hlen, + fqdn_start, hlen, FQDN_HOSTNAME, 0)) || ((dlen > 0) && - !save_option_buffer(&fqdn_universe, options, bp, first_dot, - dlen, FQDN_DOMAINNAME, 0))) + !save_option_buffer(&fqdn_universe, options, bp, + first_dot, dlen, FQDN_DOMAINNAME, 0))) goto error; } |