diff options
| author | Francesco Colista <francesco.colista@gmail.com> | 2012-05-14 08:39:59 +0000 |
|---|---|---|
| committer | Francesco Colista <francesco.colista@gmail.com> | 2012-05-14 08:39:59 +0000 |
| commit | 72eca277be71c790ce649358257e30cc1955eed5 (patch) | |
| tree | f3ff4b7bfb9a9f8b3d5bcad42ff26e62f7a7af02 /main/make/use-malloc.patch | |
| parent | 0b711a2a87090ffa1ea08c4d7960e3fc3660922f (diff) | |
| parent | bd36a10c4b580e084e8ab303810a92172b198cc0 (diff) | |
| download | aports-72eca277be71c790ce649358257e30cc1955eed5.tar.bz2 aports-72eca277be71c790ce649358257e30cc1955eed5.tar.xz | |
Merge git://dev.alpinelinux.org/aports
Diffstat (limited to 'main/make/use-malloc.patch')
| -rw-r--r-- | main/make/use-malloc.patch | 38 |
1 files changed, 38 insertions, 0 deletions
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 */ + |
