summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hankins <dhankins@isc.org>2007-01-11 16:32:09 +0000
committerDavid Hankins <dhankins@isc.org>2007-01-11 16:32:09 +0000
commitfb5fa91ab579e925ff3025bcfe2f92d7ac7e1889 (patch)
treebb758b5e1beda0dfa0fbd32964520da73e56a551
parent96deec27d6c49b201c811cf72b0776cbd56701b8 (diff)
downloadisc-dhcp-fb5fa91ab579e925ff3025bcfe2f92d7ac7e1889.tar.gz
- A bug was fixed in dhclient rendering the textual output form of the
domain-search option syntax. [ISC-Bugs #16586]
-rw-r--r--RELNOTES3
-rw-r--r--common/options.c19
2 files changed, 14 insertions, 8 deletions
diff --git a/RELNOTES b/RELNOTES
index 9fa29219..ed82d1c7 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -31,6 +31,9 @@ the README file.
- A bug was fixed where attempting to permit leasequeries results in a
fatal internal error, "Unable to find server option 49".
+- A bug was fixed in dhclient rendering the textual output form of the
+ domain-search option syntax.
+
Changes since 3.1.0a1
- A bug in the FQDN universe that added FQDN codes to the NWIP universe's
diff --git a/common/options.c b/common/options.c
index 48e2429b..632211f9 100644
--- a/common/options.c
+++ b/common/options.c
@@ -34,7 +34,7 @@
#ifndef lint
static char copyright[] =
-"$Id: options.c,v 1.98.2.3 2006/11/09 22:08:56 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
+"$Id: options.c,v 1.98.2.4 2007/01/11 16:32:09 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
#endif /* not lint */
#define DHCP_OPTION_DATA
@@ -1309,8 +1309,8 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
int numelem = 0;
int count;
int i, j, k, l;
- char fmtbuf [32];
- struct enumeration *enumbuf [32];
+ char fmtbuf[32] = "";
+ struct enumeration *enumbuf[32]; /* MUST be same as fmtbuf */
char *op = optbuf;
const unsigned char *dp = data;
struct in_addr foo;
@@ -1326,6 +1326,10 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
/* Figure out the size of the data. */
for (l = i = 0; option -> format [i]; i++, l++) {
+ if (l >= sizeof(fmtbuf) - 1)
+ log_fatal("Bounds failure on internal buffer at "
+ "%s:%d.", MDL);
+
if (!numhunk) {
log_error ("%s: Extra codes in format string: %s",
option -> name,
@@ -1336,10 +1340,6 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
fmtbuf [l] = option -> format [i];
switch (option -> format [i]) {
case 'a':
- --numelem;
- fmtbuf [l] = 0;
- numhunk = 0;
- break;
case 'A':
--numelem;
fmtbuf [l] = 0;
@@ -1350,6 +1350,7 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
while (option -> format [i] &&
option -> format [i] != '.')
i++;
+ /* Fall Through! */
case 'X':
for (k = 0; k < len; k++) {
if (!isascii (data [k]) ||
@@ -1371,8 +1372,10 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
fmtbuf [l + 1] = 0;
break;
case 'd':
+ fmtbuf[l] = 't';
+ /* Fall Through! */
case 't':
- fmtbuf [l] = 't';
+ case 'D':
fmtbuf [l + 1] = 0;
numhunk = -2;
break;