summary refs log tree commit diff
path: root/parse.y
diff options
context:
space:
mode:
authorokan <okan>2015-01-17 02:05:03 +0000
committerokan <okan>2015-01-17 02:05:03 +0000
commitc412f040df05c7221537a598786e0cea4b35167f (patch)
treecae86e94a5ac9bd3e9f7435700b6c938da22555f /parse.y
parent8d1eb202bf13dbe23d8379b095f64a10c0204676 (diff)
downloadcwm-c412f040df05c7221537a598786e0cea4b35167f.tar.gz
cwm-c412f040df05c7221537a598786e0cea4b35167f.tar.xz
cwm-c412f040df05c7221537a598786e0cea4b35167f.zip
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@
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y3
1 files changed, 3 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 590bd44..31d094d 100644
--- a/parse.y
+++ b/parse.y
@@ -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");