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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Jonathan Wakely
<[email protected]>:

https://gcc.gnu.org/g:3723bab816971351f3ba34b89c803f89d01bcbc4

commit r16-9790-g3723bab816971351f3ba34b89c803f89d01bcbc4
Author: Jonathan Wakely <[email protected]>
Date:   Thu Oct 1 22:50:13 2026 +0100

    libstdc++: Fix stack corruption in std::bitset stream extraction [PR124370]

    The __builtin_alloca argument didn't account for the size or alignment
    of wide characters.
    Replace __builtin_alloca with an array _CharT[small ? N : 1] which is
    used for small, or a heap allocation otherwise.

    libstdc++-v3/ChangeLog:

            PR libstdc++/124370
            * include/std/bitset (operator>>): Use array inside _Buffer
            instead of __builtin_alloca.
            * testsuite/20_util/bitset/io/input.cc: Suppress pedwarn about
            C++14 binary literal.
            * testsuite/20_util/bitset/io/wchar_t.cc: New test.

    Reviewed-by: Tomasz KamiÅski <[email protected]>
    (cherry picked from commit 5d419c69ce2e6b86d7da75f18736904885674219)

Reply via email to