This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][sh] Fix iov[] size in register_dump()


The incorrect size of iov array in register_dump() is resulting stack corruption.
This should be 114 (= regs*2 + fpregs*2 + "\n"*2).
/yoshii

2010-05-24  Takashi Yoshii  <takashi.yoshii.zj@renesas.com>

	* sysdeps/unix/sysv/linux/sh/sh4/register-dump.h: Fix iov[] size.

---
diff --git a/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h b/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h
index e3c9c0e..8381f9a 100644
--- a/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h
+++ b/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h
@@ -58,7 +58,7 @@ register_dump (int fd, struct sigcontext *ctx)
 {
   char regs[22][8];
   char fpregs[34][8];
-  struct iovec iov[112];
+  struct iovec iov[114];
   size_t nr = 0;
 
 #define ADD_STRING(str) \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]