Commit 64e56cf2 by Steven G. Kargl

Fix a potential buffer overflow.

From-SVN: r121958
parent 23ced53f
2007-02-14 Steven G. Kargl <kargl@gcc.gnu.org>
* misc.c (gfc_typename): Fix potential buffer overflow.
2007-02-13 Paul Thomas <pault@gcc.gnu.org> 2007-02-13 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30554 PR fortran/30554
......
...@@ -152,7 +152,8 @@ gfc_basic_typename (bt type) ...@@ -152,7 +152,8 @@ gfc_basic_typename (bt type)
const char * const char *
gfc_typename (gfc_typespec *ts) gfc_typename (gfc_typespec *ts)
{ {
static char buffer1[60], buffer2[60]; /* FIXME: Buffer overflow. */ static char buffer1[GFC_MAX_SYMBOL_LEN + 7]; /* 7 for "TYPE()" + '\0'. */
static char buffer2[GFC_MAX_SYMBOL_LEN + 7];
static int flag = 0; static int flag = 0;
char *buffer; char *buffer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment