]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- A bug was fixed in dhclient rendering the textual output form of the
authorDavid Hankins <dhankins@isc.org>
Thu, 11 Jan 2007 16:31:51 +0000 (16:31 +0000)
committerDavid Hankins <dhankins@isc.org>
Thu, 11 Jan 2007 16:31:51 +0000 (16:31 +0000)
  domain-search option syntax. [ISC-Bugs #16586]

RELNOTES
common/options.c

index b67310663bd33414e09e6ab6099ac44a08b20bbe..b617ce3b44a9825433a942b9087393afbdfd4656 100644 (file)
--- 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
index 2a1477dff3cef0e14434221cf2c406a52db60676..68812e1b11e1c6e1ddf0fc818f5e17034074cf1e 100644 (file)
@@ -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;