Hi,

The `shell' function implementation contains a long-standing potential
null dereference bug, proposed fix is attached.


-- 
ldv
2004-04-16  Dmitry V. Levin  <[EMAIL PROTECTED]>

        * function.c (func_shell): When initializing error_prefix, check
        that reading file name is not null.  This fixes long-standing
        segfault in cases like "make 'a1=$(shell :)' 'a2:=$(a1)'".

--- make-3.81beta1/function.c.orig      2004-02-24 16:50:21 +0300
+++ make-3.81beta1/function.c   2004-04-16 13:52:03 +0400
@@ -1450,7 +1450,7 @@ func_shell (char *o, char **argv, const 
   envp = environ;
 
   /* For error messages.  */
-  if (reading_file != 0)
+  if (reading_file && reading_file->filenm)
     {
       error_prefix = (char *) alloca (strlen (reading_file->filenm)+11+4);
       sprintf (error_prefix,

Attachment: pgp2Sz49fFpX7.pgp
Description: PGP signature

_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to