This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: [PATCH] Fix a buffer overflow in libgfortran (take 2)


Jakub Jelinek wrote:
On Mon, Apr 07, 2008 at 09:11:23AM -0400, Jakub Jelinek wrote:
If i?86-linux libgfortran is built with -fstack-protector, it crashes on
namelist_40 testcase, because several strings nml_parse_qualifier copies
to its parse_err_msg argument are longer than 30 bytes (two are even 37
bytes long).

Here is an updated patch which deals with the actual buffer overflows rather than cleanups that would avoid potential future buffer overflows. I'll leave the rest to libgfortran maintainers.

On the attached testcase libgfortran actually crashes even on x86_64-linux
and even without -fstack-protector, the patch cures that.

Ok for trunk/4.3?

Ok for trunk. Wait a few days before committing to 4.3, in case some unexpected problems pop up.


Thanks.

--
Janne Blomqvist


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