aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2008-12-30 18:18:09 +0000
committerChristopher Faylor <me@cgf.cx>2008-12-30 18:18:09 +0000
commitb837af5478b5b30cdaa2bdd194a442e44855e0b6 (patch)
tree965606184511027e59c29e0decebf6d67154db2a /winsup
parent5829832825e44ecd7fd35e36867d54ee3acced3c (diff)
downloadnewlib-b837af5478b5b30cdaa2bdd194a442e44855e0b6.zip
newlib-b837af5478b5b30cdaa2bdd194a442e44855e0b6.tar.gz
newlib-b837af5478b5b30cdaa2bdd194a442e44855e0b6.tar.bz2
* exceptions.cc (try_to_debug): Avoid creating a huge buffer on the stack.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/exceptions.cc5
2 files changed, 7 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index f3d47e4..47bf78a 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2008-12-30 Christopher Faylor <me+cygwin@cgf.cx>
+
+ * exceptions.cc (try_to_debug): Avoid creating a huge buffer on the
+ stack.
+
2008-12-25 Christopher Faylor <me+cygwin@cgf.cx>
* mount.cc: Change comment.
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 950ab86..4428d49 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -368,8 +368,6 @@ cygwin_stackdump ()
extern "C" int
try_to_debug (bool waitloop)
{
- WCHAR dbg_cmd[sizeof debugger_command];
-
debug_printf ("debugger_command '%s'", debugger_command);
if (*debugger_command == '\0')
return 0;
@@ -421,7 +419,8 @@ try_to_debug (bool waitloop)
console_printf ("*** starting debugger for pid %u, tid %u\n",
cygwin_pid (GetCurrentProcessId ()), GetCurrentThreadId ());
BOOL dbg;
- sys_mbstowcs (dbg_cmd, sizeof debugger_command, debugger_command);
+ WCHAR dbg_cmd[strlen(debugger_command)];
+ sys_mbstowcs (dbg_cmd, strlen(debugger_command) + 1, debugger_command);
dbg = CreateProcessW (NULL,
dbg_cmd,
NULL,