]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- Fixed a cosmetic bug where pretty-printing valid domain-search options would
authorDavid Hankins <dhankins@isc.org>
Tue, 10 Mar 2009 20:54:02 +0000 (20:54 +0000)
committerDavid Hankins <dhankins@isc.org>
Tue, 10 Mar 2009 20:54:02 +0000 (20:54 +0000)
  result in an erroneous error log message ('garbage in format string').
  [ISC-Bugs #19327]

RELNOTES
common/options.c

index 7a67556ec31730c86925a8d9f8bc3ff1fd863487..7d9b655b4ec80892ec059d1d633e3ae66a958003 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -75,6 +75,9 @@ work on other platforms. Please report any problems and suggested fixes to
 - Two uninitialized stack structures are now memset to zero, thanks to a
   patch from David Cantrell at RedHat.
 
+- Fixed a cosmetic bug where pretty-printing valid domain-search options would
+  result in an erroneous error log message ('garbage in format string').
+
                        Changes since 4.1.0b1
 
 - A missing "else" in dhcrelay.c could have caused an interface not to
index 0a4604ee8316ac9f6240fc54f5ecc361b6cb83cb..fbc1e01a571bf5027ed6f4b2a06e4b733c33147b 100644 (file)
@@ -1730,12 +1730,27 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
                        }
                        fmtbuf [l + 1] = 0;
                        break;
+                     case 'c':
+                       /* The 'c' atom is a 'D' modifier only. */
+                       log_error("'c' atom not following D atom in format "
+                                 "string: %s", option->format);
+                       break;
+                     case 'D':
+                       /*
+                        * Skip the 'c' atom, if present.  It does not affect
+                        * how we convert wire->text format (if compression is
+                        * present either way, we still process it).
+                        */
+                       if (option->format[i+1] == 'c')
+                               i++;
+                       fmtbuf[l + 1] = 0;
+                       numhunk = -2;
+                       break;
                      case 'd':
                        fmtbuf[l] = 't';
                        /* Fall Through ! */
                      case 't':
-                     case 'D':
-                       fmtbuf [l + 1] = 0;
+                       fmtbuf[l + 1] = 0;
                        numhunk = -2;
                        break;
                      case 'N':