]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Fix infinite loop if EOF in pool statement.
authorShane Kerr <shane@isc.org>
Wed, 11 Jul 2007 12:02:51 +0000 (12:02 +0000)
committerShane Kerr <shane@isc.org>
Wed, 11 Jul 2007 12:02:51 +0000 (12:02 +0000)
See RT ticket #16977 for more.

RELNOTES
server/confpars.c

index f42ee894112e5f36b7b321c9192d16e806ec053e..42c4f90c9b08de5f633243942695a19b315d8cea 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -52,6 +52,12 @@ may not work on other platforms. Please report any problems and
 suggested fixes to <dhcp-users@isc.org>.
 
 
+                       Changes since 4.0.0a2
+
+- Bug in server configuration parser caused server to get stuck on
+  startup for certain bad pool declarations. Thanks to Guillaume 
+  Knispel for the bug report and fix.
+
                        Changes since 4.0.0a1
 
 - Bug in octal parsing fixed. Thanks to Bernd Fuhrmann for the report
index d0a377e76a37ce115443ecc6f729d6a057705e20..92001b84ce584ccca8ec94656d6e8a144a2b27a7 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: confpars.c,v 1.170 2007/06/28 17:19:55 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: confpars.c,v 1.171 2007/07/11 12:02:51 shane Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -1549,6 +1549,15 @@ void parse_pool_statement (cfile, group, type)
                        done = 1;
                        break;
 
+                     case END_OF_FILE:
+                       /*
+                        * We can get to END_OF_FILE if, for instance,
+                        * the parse_statement() reads all available tokens
+                        * and leaves us at the end.
+                        */
+                       parse_warn("unexpected end of file");
+                       goto cleanup;
+
                      default:
                        declaration = parse_statement (cfile, pool -> group,
                                                       POOL_DECL,
@@ -1604,6 +1613,7 @@ void parse_pool_statement (cfile, group, type)
                log_error ("one range statement.");
        }
 
+cleanup:
        /* Dereference the lease chain. */
        lp = (struct lease *)0;
        while (lpchain) {