summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2015-11-27 21:10:17 +0000
committertedu <tedu@openbsd.org>2015-11-27 21:10:17 +0000
commit402eeae3230b8e04a762f3434ded4f9da2f5eb97 (patch)
treec5cea5f53ed9ce5c59b01d916a8f6476a380daab
parentTwo additional ioctls for pledge("disklabel"), needed by installboot. (diff)
downloadwireguard-openbsd-402eeae3230b8e04a762f3434ded4f9da2f5eb97.tar.xz
wireguard-openbsd-402eeae3230b8e04a762f3434ded4f9da2f5eb97.zip
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
-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;
}