From: Philippe Waroquiers Date: Sat, 19 Jan 2013 21:08:27 +0000 (+0000) Subject: Fix buffer overrun due to copy paste from x86 to amd64. X-Git-Tag: svn/VALGRIND_3_9_0~436 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef7a42868a74ec7f93a69e7af218fd2983417166;p=thirdparty%2Fvalgrind.git Fix buffer overrun due to copy paste from x86 to amd64. Detected by Florian (using coverity tool). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13245 --- diff --git a/coregrind/m_gdbserver/valgrind-low-amd64.c b/coregrind/m_gdbserver/valgrind-low-amd64.c index b8164518b1..82f85f0527 100644 --- a/coregrind/m_gdbserver/valgrind-low-amd64.c +++ b/coregrind/m_gdbserver/valgrind-low-amd64.c @@ -209,13 +209,13 @@ void transfer_register (ThreadId tid, int abs_regno, void * buf, case 31: if (dir == valgrind_to_gdbserver) { UChar fpreg80[10]; - convert_f64le_to_f80le ((UChar *)&amd64->guest_FPREG[regno-16], + convert_f64le_to_f80le ((UChar *)&amd64->guest_FPREG[regno-24], fpreg80); VG_(transfer) (&fpreg80, buf, dir, sizeof(fpreg80), mod); } else { ULong fpreg64; convert_f80le_to_f64le (buf, (UChar *)&fpreg64); - VG_(transfer) (&amd64->guest_FPREG[regno-16], &fpreg64, + VG_(transfer) (&amd64->guest_FPREG[regno-24], &fpreg64, dir, sizeof(fpreg64), mod); } break;