match
gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
{
- char name[GFC_MAX_SYMBOL_LEN + 1];
+ /* Provide sufficient space to hold "pdtsymbol". */
+ char name[GFC_MAX_SYMBOL_LEN + 1 + 3];
gfc_symbol *sym, *dt_sym;
match m;
char c;
return m;
gcc_assert (!sym->attr.pdt_template && sym->attr.pdt_type);
ts->u.derived = sym;
- strcpy (name, gfc_dt_lower_string (sym->name));
+ const char* lower = gfc_dt_lower_string (sym->name);
+ size_t len = strnlen (lower, sizeof (name));
+ gcc_assert (len < sizeof (name));
+ memcpy (name, lower, len);
+ name[len] = '\0';
}
if (sym && sym->attr.flavor == FL_STRUCT)
char use_assoc, saved, threadprivate;
unsigned char omp_declare_target : 1;
unsigned char omp_declare_target_link : 1;
- char name[GFC_MAX_SYMBOL_LEN + 1];
+ /* Provide sufficient space to hold "symbol.eq.1234567890". */
+ char name[GFC_MAX_SYMBOL_LEN + 1 + 14];
struct gfc_symbol *head;
const char* binding_label;
int is_bind_c;
c->where = ns->proc_name->declared_at;
else if (ns->is_block_data)
c->where = ns->sym_root->n.sym->declared_at;
- strcpy (c->name, z->module);
+
+ size_t len = strlen (z->module);
+ gcc_assert (len < sizeof (c->name));
+ memcpy (c->name, z->module, len);
+ c->name[len] = '\0';
}
else
c = NULL;