Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Mar 2018 02:25:28 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r330965 - stable/11/usr.sbin/ypldap
Message-ID:  <201803150225.w2F2PS5P041311@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Thu Mar 15 02:25:28 2018
New Revision: 330965
URL: https://svnweb.freebsd.org/changeset/base/330965

Log:
  MFC r302535:
  
  Do not allow whitespace in macro names.

Modified:
  stable/11/usr.sbin/ypldap/parse.y
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/ypldap/parse.y
==============================================================================
--- stable/11/usr.sbin/ypldap/parse.y	Thu Mar 15 02:20:06 2018	(r330964)
+++ stable/11/usr.sbin/ypldap/parse.y	Thu Mar 15 02:25:28 2018	(r330965)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803150225.w2F2PS5P041311>