svn commit: r302535 - head/usr.sbin/ypldap

Marcelo Araujo araujo at FreeBSD.org
Mon Jul 11 03:34:33 UTC 2016


Author: araujo
Date: Mon Jul 11 03:34:32 2016
New Revision: 302535
URL: https://svnweb.freebsd.org/changeset/base/302535

Log:
  Do not allow whitespace in macro names.
  
  Obtained from:	OpenBSD (r1.19).

Modified:
  head/usr.sbin/ypldap/parse.y

Modified: head/usr.sbin/ypldap/parse.y
==============================================================================
--- head/usr.sbin/ypldap/parse.y	Mon Jul 11 03:31:12 2016	(r302534)
+++ head/usr.sbin/ypldap/parse.y	Mon Jul 11 03:34:32 2016	(r302535)
@@ -144,6 +144,14 @@ include		: INCLUDE STRING			{
 		;
 
 varset		: STRING '=' STRING			{
+			char *s = $1;
+			while (*s++) {
+				if (isspace((unsigned char) *s)) {
+					yyerror("macro name cannot contain "
+					  "whitespace");
+					YYERROR;
+				}
+			}
 			if (symset($1, $3, 0) == -1)
 				fatal("cannot store variable");
 			free($1);


More information about the svn-src-all mailing list