]> Zhao Yanbai Git Server - minix.git/commitdiff
More stack for make. Fixed buffer overrun in make.
authorPhilip Homburg <philip@cs.vu.nl>
Thu, 18 Aug 2005 11:36:36 +0000 (11:36 +0000)
committerPhilip Homburg <philip@cs.vu.nl>
Thu, 18 Aug 2005 11:36:36 +0000 (11:36 +0000)
commands/make/Makefile
commands/make/make.c

index c6c423c68093dd2759ad14da2be085ba8afad37f..1bcd5b14cc1dec5c1e996c8d1897ad9fb944c9b0 100755 (executable)
@@ -8,12 +8,12 @@ all:  make
 
 make : $(OBJ)
        $(CC) -i -o make $(OBJ)
-       install -S 600k make
+       install -S 2000k make
 
 install:       /usr/bin/make
 
 /usr/bin/make: make
-       install -cs -o bin make $@
+       install -c -o bin make $@
  
 $(OBJ): h.h
 
index 4ef28ca82bd719a7fc29211e38c65591de67ce01..6be6c1d3c5bc70e03b74f1c0ca4f6ec2923c700d 100755 (executable)
@@ -665,7 +665,7 @@ char        *basename;
 char        *inputname;
 {
   register struct depend *dp;
-
+  size_t l1, l2;
 
   if (dotouch)
     touch(np);
@@ -683,6 +683,10 @@ char        *inputname;
     setDFmacro("*",basename);
 
     for (dp = qdp; dp; dp = qdp) {
+       l1= strlen(str1);
+       l2= strlen(dp->d_name->n_name);
+       while (l1 + 1 + l2 +1 > str1s.len)
+                       strrealloc(&str1s);
        if (strlen(str1))
           strcat(str1, " ");
        strcat(str1, dp->d_name->n_name);