Commit 8a302cb2 by Qing Zhao Committed by Qing Zhao

Fix an undefined behavior in fortran/decl.c

From-SVN: r255332
parent 1cde289f
2017-12-01 Qing Zhao <qing.zhao@oracle.com>
* decl.c (gfc_get_pdt_instance): Adjust the call to sprintf
to avoid the same buffer being both source and destination.
2017-12-01 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/83224
......
......@@ -3362,7 +3362,7 @@ gfc_get_pdt_instance (gfc_actual_arglist *param_list, gfc_symbol **sym,
}
gfc_extract_int (kind_expr, &kind_value);
sprintf (name, "%s_%d", name, kind_value);
sprintf (name + strlen (name), "_%d", kind_value);
if (!name_seen && actual_param)
actual_param = actual_param->next;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment