]> sourceware.org Git - glibc.git/commitdiff
Fix stack overflow in tst-setcontext9 (bug 23717)
authorAndreas Schwab <schwab@suse.de>
Thu, 27 Sep 2018 09:12:13 +0000 (11:12 +0200)
committerAndreas Schwab <schwab@suse.de>
Thu, 27 Sep 2018 10:31:03 +0000 (12:31 +0200)
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.

ChangeLog
stdlib/tst-setcontext9.c

index 85f8e097b512e47a2c73177b3d2a88a650156317..a5a64da8b8dd80f83dac3be96f013f2bcc08e999 100644 (file)
--- 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]
index db8355766ca7b9060e87244a06900f820f20ebd2..009928235dd5987ed73a117f51336284270e49d6 100644 (file)
@@ -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)
     {
This page took 0.119651 seconds and 5 git commands to generate.