From 2eaa981b579a68f8adabaad74640807821ddd131 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Thu, 20 Nov 2014 05:51:22 +0000 Subject: 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@ --- usr.sbin/ldpd/parse.y | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'usr.sbin/ldpd') diff --git a/usr.sbin/ldpd/parse.y b/usr.sbin/ldpd/parse.y index 0b84a7718ef..b75128c8d5f 100644 --- a/usr.sbin/ldpd/parse.y +++ b/usr.sbin/ldpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.22 2014/11/14 03:20:37 doug Exp $ */ +/* $OpenBSD: parse.y,v 1.23 2014/11/20 05:51:20 jsg Exp $ */ /* * Copyright (c) 2004, 2005, 2008 Esben Norby @@ -585,6 +585,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"); -- cgit v1.2.3