From: David Hankins Date: Thu, 11 Jan 2007 16:31:51 +0000 (+0000) Subject: - A bug was fixed in dhclient rendering the textual output form of the X-Git-Tag: v4_0_0a1~56 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=85edef5cfe3f24ab0f94656454b00ceeaed2172d;p=thirdparty%2Fdhcp.git - A bug was fixed in dhclient rendering the textual output form of the domain-search option syntax. [ISC-Bugs #16586] --- diff --git a/RELNOTES b/RELNOTES index b67310663..b617ce3b4 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 2a1477dff..68812e1b1 100644 --- a/common/options.c +++ b/common/options.c @@ -34,7 +34,7 @@ #ifndef lint static char copyright[] = -"$Id: options.c,v 1.101 2006/11/09 22:08:28 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; +"$Id: options.c,v 1.102 2007/01/11 16:31:51 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;