diff options
author | jsg <jsg@openbsd.org> | 2014-11-20 05:51:20 +0000 |
---|---|---|
committer | jsg <jsg@openbsd.org> | 2014-11-20 05:51:20 +0000 |
commit | 41eef22fadfe246e281a52adf5b78e8110cc2a5f (patch) | |
tree | eb302f521729e39b3a4f3c369fb234c98eee671f /usr.sbin/dvmrpd | |
parent | use ${SHELL} to run scripts in the src tree (diff) | |
download | wireguard-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/dvmrpd')
-rw-r--r-- | usr.sbin/dvmrpd/parse.y | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/dvmrpd/parse.y b/usr.sbin/dvmrpd/parse.y index cef0d3a2ae6..66b7b73d157 100644 --- a/usr.sbin/dvmrpd/parse.y +++ b/usr.sbin/dvmrpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.28 2014/11/14 03:20:36 doug Exp $ */ +/* $OpenBSD: parse.y,v 1.29 2014/11/20 05:51:20 jsg Exp $ */ /* * Copyright (c) 2004, 2005, 2006 Esben Norby <norby@openbsd.org> @@ -570,6 +570,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"); |