aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/match.c
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2021-03-22 09:49:48 +0100
committerTobias Burnus <tobias@codesourcery.com>2021-03-22 09:50:50 +0100
commit0e792ee11aa6ebb6f61e9ed33eb06e260f0ec703 (patch)
treefa23c3ed334ae9d39aff259fdd462667e0c3e6e4 /gcc/fortran/match.c
parentfc9c4e5fc50c7fcbd27d6cb3dd372f7da8216954 (diff)
downloadgcc-0e792ee11aa6ebb6f61e9ed33eb06e260f0ec703.zip
gcc-0e792ee11aa6ebb6f61e9ed33eb06e260f0ec703.tar.gz
gcc-0e792ee11aa6ebb6f61e9ed33eb06e260f0ec703.tar.bz2
Fortran: Fix 'name' bound size [PR99688]
gcc/fortran/ChangeLog: PR fortran/99688 * match.c (select_type_set_tmp, gfc_match_select_type, gfc_match_select_rank): Fix 'name' buffersize to avoid out of bounds. * resolve.c (resolve_select_type): Likewise.
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r--gcc/fortran/match.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 4d5890f..393755e 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -6330,7 +6330,7 @@ select_intrinsic_set_tmp (gfc_typespec *ts)
static void
select_type_set_tmp (gfc_typespec *ts)
{
- char name[GFC_MAX_SYMBOL_LEN];
+ char name[GFC_MAX_SYMBOL_LEN + 12 + 1];
gfc_symtree *tmp = NULL;
gfc_symbol *selector = select_type_stack->selector;
gfc_symbol *sym;
@@ -6409,7 +6409,7 @@ gfc_match_select_type (void)
{
gfc_expr *expr1, *expr2 = NULL;
match m;
- char name[GFC_MAX_SYMBOL_LEN];
+ char name[GFC_MAX_SYMBOL_LEN + 1];
bool class_array;
gfc_symbol *sym;
gfc_namespace *ns = gfc_current_ns;
@@ -6634,7 +6634,7 @@ gfc_match_select_rank (void)
{
gfc_expr *expr1, *expr2 = NULL;
match m;
- char name[GFC_MAX_SYMBOL_LEN];
+ char name[GFC_MAX_SYMBOL_LEN + 1];
gfc_symbol *sym, *sym2;
gfc_namespace *ns = gfc_current_ns;
gfc_array_spec *as = NULL;