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

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

https://gcc.gnu.org/g:11a1cf805aac7b7db21bd2ea6cc22a69f5aa92f9

commit r17-595-g11a1cf805aac7b7db21bd2ea6cc22a69f5aa92f9
Author: Jonathan Wakely <[email protected]>
Date:   Mon May 18 15:44:21 2026 +0100

    libstdc++: Make chrono::parse fail for bad %z [PR125369]

    The chrono parsing code failed to check for errors when parsing input to
    match %z. The expected input is [+-]hh[mm] but if we read less than two
    valid digits for the hh or mm parts we didn't set failbit in the stream,
    and used the -1 error values returned for each bad digit in the offset
    value. This resulted in a "successful" parse that produced a value like
    -11h or -11min for the time zone offset.

    libstdc++-v3/ChangeLog:

            PR libstdc++/125369
            * include/bits/chrono_io.h (__detail::_Parser::operator()):
            Check for errors when parsing digits for a %z format.
            * testsuite/std/time/parse/125369.cc: New test.

    Reviewed-by: Tomasz KamiÅski <[email protected]>

Reply via email to