Fix a potential buffer overflow.

From-SVN: r121958
This commit is contained in:
Steven G. Kargl 2007-02-14 20:02:39 +00:00
parent 23ced53f12
commit 64e56cf255
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,7 @@
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>
PR fortran/30554

View file

@ -152,7 +152,8 @@ gfc_basic_typename (bt type)
const char *
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;
char *buffer;