From 8fdacab3041bfc9ede24797ea378d37686381aae Mon Sep 17 00:00:00 2001 From: krw Date: Mon, 13 Jan 2014 20:56:24 +0000 Subject: [PATCH] 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 '}'. --- sbin/dhclient/parse.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 == '{') { -- 2.20.1