aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2018-09-27 11:12:13 +0200
committerAndreas Schwab <schwab@suse.de>2018-09-27 12:31:03 +0200
commitf841c97e515a1673485a2b12b3c280073d737890 (patch)
tree67decd1b815cb83bcee1fd064fe298a8e9b99c77
parent6ca8284e7a522ce3cdc9fdd2e73795c753890634 (diff)
downloadglibc-f841c97e515a1673485a2b12b3c280073d737890.zip
glibc-f841c97e515a1673485a2b12b3c280073d737890.tar.gz
glibc-f841c97e515a1673485a2b12b3c280073d737890.tar.bz2
Fix stack overflow in tst-setcontext9 (bug 23717)
The function f1a, executed on a stack of size 32k, allocates an object of size 32k on the stack. Make the stack variables static to reduce excessive stack usage.
-rw-r--r--ChangeLog6
-rw-r--r--stdlib/tst-setcontext9.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 85f8e09..a5a64da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-09-27 Andreas Schwab <schwab@suse.de>
+
+ [BZ #23717]
+ * stdlib/tst-setcontext9.c (f1a): Make st2 static.
+ (do_test): Make st1 static.
+
2018-09-26 Andreas Schwab <schwab@suse.de>
[BZ #23707]
diff --git a/stdlib/tst-setcontext9.c b/stdlib/tst-setcontext9.c
index db83557..0099282 100644
--- a/stdlib/tst-setcontext9.c
+++ b/stdlib/tst-setcontext9.c
@@ -58,7 +58,7 @@ f1b (void)
static void
f1a (void)
{
- char st2[32768];
+ static char st2[32768];
puts ("start f1a");
if (getcontext (&ctx[2]) != 0)
{
@@ -93,7 +93,7 @@ f1a (void)
static int
do_test (void)
{
- char st1[32768];
+ static char st1[32768];
puts ("making contexts");
if (getcontext (&ctx[0]) != 0)
{