Author: rmh
Date: 2006-02-12 16:48:30 +0000 (Sun, 12 Feb 2006)
New Revision: 1176

Added:
   trunk/freebsd6-buildutils/debian/patches/000_fix_make_double_free.diff
Log:
patches/000_fix_make_double_free.diff: New.  Patch from upstream (1.155:1.158). 
 Thanks to Petr for spotting this.

Added: trunk/freebsd6-buildutils/debian/patches/000_fix_make_double_free.diff
===================================================================
--- trunk/freebsd6-buildutils/debian/patches/000_fix_make_double_free.diff      
2006-02-12 12:13:44 UTC (rev 1175)
+++ trunk/freebsd6-buildutils/debian/patches/000_fix_make_double_free.diff      
2006-02-12 16:48:30 UTC (rev 1176)
@@ -0,0 +1,44 @@
+
+Patch from upstream (1.155:1.158).  Thanks to Petr for spotting this.
+
+--- src.old/usr.bin/make/main.c        2006-02-12 17:43:38.000000000 +0100
++++ src/usr.bin/make/main.c    2006-02-12 17:44:22.000000000 +0100
+@@ -235,14 +235,14 @@
+ static Boolean
+ ReadMakefile(const char p[])
+ {
+-      char *fname;                    /* makefile to read */
++      char *fname, *fnamesave;        /* makefile to read */
+       FILE *stream;
+       char *name, path[MAXPATHLEN];
+       char *MAKEFILE;
+       int setMAKEFILE;
+ 
+       /* XXX - remove this once constification is done */
+-      fname = estrdup(p);
++      fnamesave = fname = estrdup(p);
+ 
+       if (!strcmp(fname, "-")) {
+               Parse_File("(stdin)", stdin);
+@@ -297,8 +297,10 @@
+               name = Path_FindFile(fname, &parseIncPath);
+               if (!name)
+                       name = Path_FindFile(fname, &sysIncPath);
+-              if (!name || !(stream = fopen(name, "r")))
++              if (!name || !(stream = fopen(name, "r"))) {
++                      free(fnamesave);
+                       return (FALSE);
++              }
+               MAKEFILE = fname = name;
+               /*
+                * set the MAKEFILE variable desired by System V fans -- the
+@@ -309,8 +311,8 @@
+               if (setMAKEFILE)
+                       Var_SetGlobal("MAKEFILE", MAKEFILE);
+               Parse_File(fname, stream);
+-              fclose(stream);
+       }
++      free(fnamesave);
+       return (TRUE);
+ }
+ 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to