summaryrefslogtreecommitdiff
path: root/gdb/symm-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/symm-nat.c')
-rw-r--r--gdb/symm-nat.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/symm-nat.c b/gdb/symm-nat.c
index 183fa9198dd..d6867774310 100644
--- a/gdb/symm-nat.c
+++ b/gdb/symm-nat.c
@@ -764,8 +764,11 @@ child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
= (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1)
/ sizeof (PTRACE_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 PTRACE_XFER_TYPE *buffer
- = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
+ = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
if (write)
{