[PATCH] AIX: Fix buffer overflow in fill_fprs

Joel Brobecker brobecker@adacore.com
Tue Mar 13 22:36:00 GMT 2012


> The callers of fill_fprs expect the first floating point register to be
> written to vals[0], but it's currently written to
> vals[tdep->ppc_fp0_regnum] which can cause GDB to segfault as the
> caller's buffer overflows.
> 
> 2012-03-08  Chris January  <chris.january@allinea.com>
> 
> 	* aix-thread.c (fill_sprs): Store the floating point registers
> 	at the correct offsets into vals.

This looks right to me. I tested it on AIX for you and checked it in.

While doing this, I looked at the opposite function, and found
that it was ok, but with a regno meaning something different.
The implementation in fill_sprs seems more natural to me, so
I fixed supply_fprs as attached.

Thanks again for the patch.

PS: I reformatted your ChangeLog entry. We try to keep lines under
    70 characters long, with a hard-limit at 80 characters...

-- 
Joel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Minor-cleanup-in-aix-thread.c-supply_fprs.patch
Type: text/x-diff
Size: 1642 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20120313/17a1f9f5/attachment.bin>


More information about the Gdb-patches mailing list