From: krw Date: Mon, 13 Jan 2014 21:36:46 +0000 (+0000) Subject: Don't eat another token looking for a ';' after skip_to_semi() has X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1ad17cd4b9e91f5f9e16a41e55a79052b80621a3;p=openbsd Don't eat another token looking for a ';' after skip_to_semi() has been invoked. Fixes silent loss of the statement following a broken or inapplicable 'interface' declaration in a lease, or an unrecognized lease attribute. --- diff --git a/sbin/dhclient/clparse.c b/sbin/dhclient/clparse.c index 9373a61ca2a..29949c19110 100644 --- a/sbin/dhclient/clparse.c +++ b/sbin/dhclient/clparse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clparse.c,v 1.69 2014/01/13 21:04:19 krw Exp $ */ +/* $OpenBSD: clparse.c,v 1.70 2014/01/13 21:36:46 krw Exp $ */ /* Parser for dhclient config and lease files. */ @@ -536,12 +536,12 @@ parse_client_lease_declaration(FILE *cfile, struct client_lease *lease) if (token != TOK_STRING) { parse_warn("expecting interface name (in quotes)."); skip_to_semi(cfile); - break; + return; } if (strcmp(ifi->name, val) != 0) { parse_warn("wrong interface name."); skip_to_semi(cfile); - break; + return; } break; case TOK_FIXED_ADDR: @@ -576,7 +576,7 @@ parse_client_lease_declaration(FILE *cfile, struct client_lease *lease) default: parse_warn("expecting lease declaration."); skip_to_semi(cfile); - break; + return; } token = next_token(&val, cfile); if (token != ';') {