Commit 237f8d3a authored by Shane Kerr's avatar Shane Kerr
Browse files

Fix infinite loop if EOF in pool statement.

See RT ticket #16977 for more.
parent 2010d35a
......@@ -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
......
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment