diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2014-11-20 05:51:22 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2014-11-20 05:51:22 +0000 |
commit | 2eaa981b579a68f8adabaad74640807821ddd131 (patch) | |
tree | b12cf2076861693c4d14b3a5130ee1ff2dca4fc8 /usr.sbin/npppd | |
parent | 6a369f972afd1add899318b0d0d9d2b2877778e0 (diff) |
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/npppd')
-rw-r--r-- | usr.sbin/npppd/npppd/parse.y | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/npppd/npppd/parse.y b/usr.sbin/npppd/npppd/parse.y index f075b9c6c54..34cc4e0a6a9 100644 --- a/usr.sbin/npppd/npppd/parse.y +++ b/usr.sbin/npppd/npppd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.14 2014/11/16 19:07:50 bluhm Exp $ */ +/* $OpenBSD: parse.y,v 1.15 2014/11/20 05:51:20 jsg Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -1233,6 +1233,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"); |