diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-05-11 12:53:41 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-05-11 15:04:40 +0000 |
commit | b52b755ab9f894eef260967918dc7343d6d19e73 (patch) | |
tree | 0cdafe5a95f75120b0b360d3847256d9e6999635 /main/make | |
parent | a52c9d823621e469d6052aac1f4aab74cce1fe10 (diff) | |
download | aports-b52b755ab9f894eef260967918dc7343d6d19e73.tar.bz2 aports-b52b755ab9f894eef260967918dc7343d6d19e73.tar.xz |
main/make: fix stack overflow when long command lines
Fixes building webkit
https://savannah.gnu.org/bugs/index.php?36451
Diffstat (limited to 'main/make')
-rw-r--r-- | main/make/APKBUILD | 6 | ||||
-rw-r--r-- | main/make/use-malloc.patch | 38 |
2 files changed, 42 insertions, 2 deletions
diff --git a/main/make/APKBUILD b/main/make/APKBUILD index aa11050de2..9f4f452fb4 100644 --- a/main/make/APKBUILD +++ b/main/make/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=make pkgver=3.82 -pkgrel=3 +pkgrel=4 pkgdesc="GNU make utility to maintain groups of programs" url="http://www.gnu.org/software/make" arch="all" @@ -15,6 +15,7 @@ source="ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.gz make-3.82-jobserver.patch make-3.82-expensive_glob.patch make-3.82-parallel-remake.patch + use-malloc.patch " _builddir="$srcdir"/$pkgname-$pkgver @@ -47,4 +48,5 @@ md5sums="7f7c000e3b30c6840f2e9cf86b254fac make-3.82.tar.gz 0436e740edbc81cf27fd598241b8dcf0 make-3.82-memory-corruption.patch 923a06973f4bbc9f27c2ca88a6940d45 make-3.82-jobserver.patch f2ed48ea701e8ab6e5b870a3d125b71a make-3.82-expensive_glob.patch -89f8032d2f314eb6338739f024d8ecec make-3.82-parallel-remake.patch" +89f8032d2f314eb6338739f024d8ecec make-3.82-parallel-remake.patch +44469128d5044e14ac48b3b991889ceb use-malloc.patch" diff --git a/main/make/use-malloc.patch b/main/make/use-malloc.patch new file mode 100644 index 0000000000..8e3284c03e --- /dev/null +++ b/main/make/use-malloc.patch @@ -0,0 +1,38 @@ +Use malloc when construction the command argv instead of stack space. +This fixes overflowing the stack when building webkit on uclibc based +systems. + +https://savannah.gnu.org/bugs/index.php?36451 + +--- ./job.c.orig ++++ ./job.c +@@ -2865,7 +2865,7 @@ + return new_argv; + } + +- new_line = alloca (shell_len + 1 + sflags_len + 1 ++ new_line = xmalloc (shell_len + 1 + sflags_len + 1 + + (line_len*2) + 1); + ap = new_line; + memcpy (ap, shell, shell_len); +@@ -2923,9 +2923,11 @@ + #endif + *ap++ = *p; + } +- if (ap == new_line + shell_len + sflags_len + 2) ++ if (ap == new_line + shell_len + sflags_len + 2) { + /* Line was empty. */ ++ free (new_line); + return 0; ++ } + *ap = '\0'; + + #ifdef WINDOWS32 +@@ -3065,6 +3067,7 @@ + fatal (NILF, _("%s (line %d) Bad shell context (!unixy && !batch_mode_shell)\n"), + __FILE__, __LINE__); + #endif ++ free (new_line); + } + #endif /* ! AMIGA */ + |