summaryrefslogtreecommitdiff
path: root/server/confpars.c
diff options
context:
space:
mode:
authorShawn Routhier <sar@isc.org>2015-06-23 12:14:20 -0700
committerShawn Routhier <sar@isc.org>2015-06-23 12:14:20 -0700
commit46d31b510caf143005c18f3070e0ec08627ac0e7 (patch)
tree9f9b39e89abeb8e3e6b9b8f69f295136a494a3f9 /server/confpars.c
parente422b8c78f8cb22ada4675ce9bb0372d739a0013 (diff)
downloadisc-dhcp-46d31b510caf143005c18f3070e0ec08627ac0e7.tar.gz
[master] Hnadle corrupt v6 lease files better.
Stop processing a v6 lease file when encountering an EOF while trying to read an ia structure.
Diffstat (limited to 'server/confpars.c')
-rw-r--r--server/confpars.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/server/confpars.c b/server/confpars.c
index 3240e5cc..415a38be 100644
--- a/server/confpars.c
+++ b/server/confpars.c
@@ -4658,6 +4658,15 @@ parse_ia_na_declaration(struct parse *cfile) {
if (token == RBRACE) break;
switch(token) {
+ case END_OF_FILE:
+ /* We hit the end of file and don't know
+ * what parts of the lease we may be missing
+ * don't try to salvage the lease
+ */
+ parse_warn(cfile, "corrupt lease file; "
+ "unexpected end of file");
+ return;
+
/* Lease binding state. */
case BINDING:
token = next_token(&val, NULL, cfile);
@@ -5100,6 +5109,15 @@ parse_ia_ta_declaration(struct parse *cfile) {
if (token == RBRACE) break;
switch(token) {
+ case END_OF_FILE:
+ /* We hit the end of file and don't know
+ * what parts of the lease we may be missing
+ * don't try to salvage the lease
+ */
+ parse_warn(cfile, "corrupt lease file; "
+ "unexpected end of file");
+ return;
+
/* Lease binding state. */
case BINDING:
token = next_token(&val, NULL, cfile);
@@ -5543,6 +5561,15 @@ parse_ia_pd_declaration(struct parse *cfile) {
if (token == RBRACE) break;
switch(token) {
+ case END_OF_FILE:
+ /* We hit the end of file and don't know
+ * what parts of the lease we may be missing
+ * don't try to salvage the lease
+ */
+ parse_warn(cfile, "corrupt lease file; "
+ "unexpected end of file");
+ return;
+
/* Prefix binding state. */
case BINDING:
token = next_token(&val, NULL, cfile);