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

Janne Blomqvist blomqvist.janne@gmail.com
Tue Apr 8 20:35:00 GMT 2008


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



More information about the Fortran mailing list