]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Avoid crashes when SHELL=abcde is specified on the command line
authorEli Zaretskii <eliz@gnu.org>
Wed, 7 Jun 2017 05:32:35 +0000 (08:32 +0300)
committerEli Zaretskii <eliz@gnu.org>
Wed, 7 Jun 2017 05:32:35 +0000 (08:32 +0300)
* variable.c (do_variable_definition): If $SHELL was not found,
process "SHELL=foo" as any other variable definition.  This avoids
segfaults when SHELL=foo is specified on the Make command line.
Reported by Orgad Shaneh <orgads@gmail.com>.

variable.c

index ca66ecd7d2d76a2cca20eaa26684f22d6b37eaf7..364774f05064ca1af64fcf1947bce4b17696abec 100644 (file)
@@ -1404,6 +1404,11 @@ do_variable_definition (const floc *flocp, const char *varname,
         }
     }
   else
+    v = NULL;
+
+  /* If not $SHELL, or if $SHELL points to a program we didn't find,
+     just process this variable "as usual".  */
+  if (!v)
 #endif
 
   /* If we are defining variables inside an $(eval ...), we might have a