summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ifstated
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2014-11-20 05:51:20 +0000
committerjsg <jsg@openbsd.org>2014-11-20 05:51:20 +0000
commit41eef22fadfe246e281a52adf5b78e8110cc2a5f (patch)
treeeb302f521729e39b3a4f3c369fb234c98eee671f /usr.sbin/ifstated
parentuse ${SHELL} to run scripts in the src tree (diff)
downloadwireguard-openbsd-41eef22fadfe246e281a52adf5b78e8110cc2a5f.tar.xz
wireguard-openbsd-41eef22fadfe246e281a52adf5b78e8110cc2a5f.zip
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@
Diffstat (limited to 'usr.sbin/ifstated')
-rw-r--r--usr.sbin/ifstated/parse.y5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/ifstated/parse.y b/usr.sbin/ifstated/parse.y
index 6ffa2098ad6..4794352c21a 100644
--- a/usr.sbin/ifstated/parse.y
+++ b/usr.sbin/ifstated/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.35 2014/11/03 18:44:36 bluhm Exp $ */
+/* $OpenBSD: parse.y,v 1.36 2014/11/20 05:51:20 jsg Exp $ */
/*
* Copyright (c) 2004 Ryan McBride <mcbride@openbsd.org>
@@ -568,6 +568,9 @@ top:
} 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");