On Mai 30 2020, Harald Anlauf wrote:
> diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
> index db395624a16..6d0924da2b8 100644
> --- a/gcc/fortran/class.c
> +++ b/gcc/fortran/class.c
> @@ -484,7 +484,12 @@ get_unique_type_string (char *string, gfc_symbol
> *derived)
> if (derived->attr.unlimited_polymorphic)
> strcpy (dt_name, "STAR");
> else
> - strncpy (dt_name, gfc_dt_upper_string (derived->name), sizeof (dt_name));
> + {
> + dt_name[sizeof (dt_name)-1] = '\0';
> + strcpy (dt_name, gfc_dt_upper_string (derived->name));
> + if (dt_name[sizeof (dt_name)-1] != '\0')
> + gfc_internal_error ("get_unique_type_string: identifier overflow");
> + }
Why do you need to create the copy in the first place?
Please revert, if you cannot fix that soon.
Andreas.
--
Andreas Schwab, [email protected]
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."