summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2015-11-27 21:10:18 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2015-11-27 21:10:18 +0000
commit7a39b9176a2952ab2a3af96d4952a54648c36f00 (patch)
treea38f10852a8d2614c2fa0147b25fa694b37356cf /usr.bin
parent74f783865ad6e287b806f93d7f9c090954fc3719 (diff)
after reading a too long line, restart at the beginning of the buffer so
we don't keep writing past the end. (the perils of trying to recover from parse errors.) noticed by Jan Schreiber
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/doas/parse.y6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/doas/parse.y b/usr.bin/doas/parse.y
index b63e9b2fe6c..f87b9d9f914 100644
--- a/usr.bin/doas/parse.y
+++ b/usr.bin/doas/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.12 2015/09/01 16:20:55 mikeb Exp $ */
+/* $OpenBSD: parse.y,v 1.13 2015/11/27 21:10:17 tedu Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
@@ -284,8 +284,10 @@ repeat:
}
}
*p++ = c;
- if (p == ebuf)
+ if (p == ebuf) {
yyerror("too long line");
+ p = buf;
+ }
escape = 0;
}