diff options
Diffstat (limited to 'gdb/infttrace.c')
-rw-r--r-- | gdb/infttrace.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/infttrace.c b/gdb/infttrace.c index c3216a5f0e0..df0a5e579d7 100644 --- a/gdb/infttrace.c +++ b/gdb/infttrace.c @@ -4922,8 +4922,11 @@ child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, = (((memaddr + len) - addr) + sizeof (TTRACE_XFER_TYPE) - 1) / sizeof (TTRACE_XFER_TYPE); /* Allocate buffer of that many longwords. */ + /* FIXME (alloca): This code, cloned from infptrace.c, is unsafe + because it uses alloca to allocate a buffer of arbitrary size. + For very large xfers, this could crash GDB's stack. */ register TTRACE_XFER_TYPE *buffer - = (TTRACE_XFER_TYPE *) alloca (count * sizeof (TTRACE_XFER_TYPE)); + = (TTRACE_XFER_TYPE *) alloca (count * sizeof (TTRACE_XFER_TYPE)); if (write) { |