https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119671
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:e33b62eed7fd0a82d758b23252d288585b6790d2 commit r15-9273-ge33b62eed7fd0a82d758b23252d288585b6790d2 Author: Jonathan Wakely <jwak...@redhat.com> Date: Mon Apr 7 19:52:55 2025 +0100 libstdc++: Fix use-after-free in std::format [PR119671] When formatting floating-point values to wide strings there's a case where we invalidate a std::wstring buffer while a std::wstring_view is still referring to it. libstdc++-v3/ChangeLog: PR libstdc++/119671 * include/std/format (__formatter_fp::format): Do not invalidate __wstr unless _M_localized returns a valid string. * testsuite/std/format/functions/format.cc: Check wide string formatting of floating-point types with classic locale. Reviewed-by: Tomasz Kaminski <tkami...@redhat.com>