gcc/libgfortran
Jerry DeLisle 03932d3203 Fortran: Fix issue with using snprintf function.
The previous patch used snprintf to set the message
string. The message string is not a formatted string
and the snprintf will interpret '%' related characters
as format specifiers when there are no associated
output variables. A segfault ensues.

This change replaces snprintf with a fortran string copy
function and null terminates the message string.

	PR libfortran/105456

libgfortran/ChangeLog:

	* io/list_read.c (list_formatted_read_scalar): Use fstrcpy
	from libgfortran/runtime/string.c to replace snprintf.
	(nml_read_obj): Likewise.
	* io/transfer.c (unformatted_read): Likewise.
	(unformatted_write): Likewise.
	(formatted_transfer_scalar_read): Likewise.
	(formatted_transfer_scalar_write): Likewise.
	* io/write.c (list_formatted_write_scalar): Likewise.
	(nml_write_obj): Likewise.

gcc/testsuite/ChangeLog:

	* gfortran.dg/pr105456.f90: Revise using '%' characters
	in users error message.
2024-03-06 19:57:05 -08:00
..
caf
config
generated
ieee
intrinsics
io Fortran: Fix issue with using snprintf function. 2024-03-06 19:57:05 -08:00
m4
runtime
acinclude.m4
aclocal.m4
c99_protos.h
ChangeLog Daily bump. 2024-03-07 00:17:38 +00:00
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog-2020
ChangeLog-2021
ChangeLog-2022
ChangeLog-2023
config.h.in
configure
configure.ac
configure.host
gfortran.map
ISO_Fortran_binding.h
kinds-override.h
libgfortran.h
libgfortran.spec.in
libtool-version
Makefile.am
Makefile.in
mk-kinds-h.sh
mk-sik-inc.sh
mk-srk-inc.sh