From: krw Date: Mon, 13 Jan 2014 20:56:24 +0000 (+0000) Subject: Don't eat two tokens when encountering a non-terminal '}'. Avoids X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8fdacab3041bfc9ede24797ea378d37686381aae;p=openbsd Don't eat two tokens when encountering a non-terminal '}'. Avoids possibly ignoring entire rest of dhclient.conf or dhclient.leases.if looking for a mistakenly consumed '}'. --- diff --git a/sbin/dhclient/parse.c b/sbin/dhclient/parse.c index 387a355cd3f..31f49f8f160 100644 --- a/sbin/dhclient/parse.c +++ b/sbin/dhclient/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.29 2014/01/10 01:38:15 krw Exp $ */ +/* $OpenBSD: parse.c,v 1.30 2014/01/13 20:56:24 krw Exp $ */ /* Common parser code for dhcpd and dhclient. */ @@ -70,9 +70,10 @@ skip_to_semi(FILE *cfile) token = peek_token(NULL, cfile); if (token == '}') { if (brace_count) { - token = next_token(NULL, cfile); - if (!--brace_count) + if (!--brace_count) { + token = next_token(NULL, cfile); return; + } } else return; } else if (token == '{') {