https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119671

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Jonathan Wakely
<r...@gcc.gnu.org>:

https://gcc.gnu.org/g:059107eb22c4800be94abb1ff9085341cc851432

commit r14-11542-g059107eb22c4800be94abb1ff9085341cc851432
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>
    (cherry picked from commit e33b62eed7fd0a82d758b23252d288585b6790d2)

Reply via email to