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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to