public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-7873] fortran: Fix off-by-one in buffer sizes.
@ 2021-03-27 22:05 Jerry DeLisle
  0 siblings, 0 replies; only message in thread
From: Jerry DeLisle @ 2021-03-27 22:05 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:01685676a9309bc0b8b2f4697c23bd6aa0e00d5d

commit r11-7873-g01685676a9309bc0b8b2f4697c23bd6aa0e00d5d
Author: Steve Kargl <kargl@gcc.gnu.org>
Date:   Sat Mar 27 15:02:16 2021 -0700

    fortran: Fix off-by-one in buffer sizes.
    
    gcc/fortran/ChangeLog:
    
            * misc.c (gfc_typename): Fix off-by-one in buffer sizes.

Diff:
---
 gcc/fortran/misc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/fortran/misc.c b/gcc/fortran/misc.c
index 8a96243e80d..3d449ae17fe 100644
--- a/gcc/fortran/misc.c
+++ b/gcc/fortran/misc.c
@@ -124,8 +124,10 @@ gfc_basic_typename (bt type)
 const char *
 gfc_typename (gfc_typespec *ts, bool for_hash)
 {
-  static char buffer1[GFC_MAX_SYMBOL_LEN + 7];  /* 7 for "TYPE()" + '\0'.  */
-  static char buffer2[GFC_MAX_SYMBOL_LEN + 7];
+  /* Need to add sufficient padding for "TYPE()" + '\0', "UNION()" + '\0',
+     or "CLASS()" + '\0'.  */
+  static char buffer1[GFC_MAX_SYMBOL_LEN + 8];
+  static char buffer2[GFC_MAX_SYMBOL_LEN + 8];
   static int flag = 0;
   char *buffer;
   gfc_typespec *ts1;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-27 22:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-27 22:05 [gcc r11-7873] fortran: Fix off-by-one in buffer sizes Jerry DeLisle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).