From d45066257cc9df6aa61eb1d71cd56cf4ae76af53 Mon Sep 17 00:00:00 2001 From: Philip Homburg Date: Thu, 18 Aug 2005 11:36:36 +0000 Subject: [PATCH] More stack for make. Fixed buffer overrun in make. --- commands/make/Makefile | 4 ++-- commands/make/make.c | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/commands/make/Makefile b/commands/make/Makefile index c6c423c68..1bcd5b14c 100755 --- a/commands/make/Makefile +++ b/commands/make/Makefile @@ -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 diff --git a/commands/make/make.c b/commands/make/make.c index 4ef28ca82..6be6c1d3c 100755 --- a/commands/make/make.c +++ b/commands/make/make.c @@ -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); -- 2.44.0