Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jul 2016 03:34:32 +0000 (UTC)
From:      Marcelo Araujo <araujo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r302535 - head/usr.sbin/ypldap
Message-ID:  <201607110334.u6B3YWrH081081@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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