summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2015-01-17 02:05:04 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2015-01-17 02:05:04 +0000
commitcf85b4e5aea74c9d26c95d1304de8d38f4073bff (patch)
treee89de8380a6384172771a441e18947648f4bbc9a
parentb0147b7d38ab141208bd7c6cfa0746a596db8832 (diff)
Catch up with src parse.y changes by jsg@:
Don't allow embedded nul characters in strings. Fixes a pfctl crash with an anchor name containing an embedded nul found with the afl fuzzer. pfctl parse.y patch from and ok deraadt@
-rw-r--r--app/cwm/parse.y5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/cwm/parse.y b/app/cwm/parse.y
index 63b5def89..2ee5727bb 100644
--- a/app/cwm/parse.y
+++ b/app/cwm/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.59 2015/01/16 18:28:08 okan Exp $ */
+/* $OpenBSD: parse.y,v 1.60 2015/01/17 02:05:03 okan Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -438,6 +438,9 @@ yylex(void)
} else if (c == quotec) {
*p = '\0';
break;
+ } else if (c == '\0') {
+ yyerror("syntax error");
+ return (findeol());
}
if (p + 1 >= buf + sizeof(buf) - 1) {
yyerror("string too long");