[PATCH] Fix a buffer overflow in libgfortran (take 2)
Jerry DeLisle
jvdelisle@verizon.net
Wed Apr 9 06:04:00 GMT 2008
On Tue, 2008-04-08 at 14:30 -0400, 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?
>
I am curious why we don't just use the usual generate_error function in
all these places so that this kind of issue could be fixed in one place.
Otherwise the patch is OK to commit and I will follow up and study this
to answer my own question.
Thanks,
Jerry
More information about the Fortran
mailing list