public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/95851] [10/11 Regression] std::to_chars(p, p, c, 2) segfault Date: Wed, 24 Jun 2020 15:02:23 +0000 [thread overview] Message-ID: <bug-95851-4-OLlWH7OhjW@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-95851-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95851 --- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:ff5c8fe44a98025c1e700cfc033247965e293869 commit r10-8360-gff5c8fe44a98025c1e700cfc033247965e293869 Author: Jonathan Wakely <jwakely@redhat.com> Date: Tue Jun 23 22:47:58 2020 +0100 libstdc++: Fix std::to_chars buffer overflow (PR 95851) The __detail::__to_chars_2 function assumes it won't be called with zero values. However, when the output buffer is empty the caller doesn't handle zero values correctly, and calls __to_chars_2 with a zero value, resulting in an overflow of the empty buffer. The __detail::__to_chars_i function should just return immediately for an empty buffer, and otherwise ensure zero values are handled properly. libstdc++-v3/ChangeLog: PR libstdc++/95851 * include/std/charconv (__to_chars_i): Check for zero-sized buffer unconditionally. * testsuite/20_util/to_chars/95851.cc: New test. (cherry picked from commit be50843754b4c4d47f0d628a84b3dbf2a4145a43)
next prev parent reply other threads:[~2020-06-24 15:02 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-06-23 21:43 [Bug libstdc++/95851] New: " redi at gcc dot gnu.org 2020-06-23 21:44 ` [Bug libstdc++/95851] " redi at gcc dot gnu.org 2020-06-24 11:55 ` cvs-commit at gcc dot gnu.org 2020-06-24 15:02 ` cvs-commit at gcc dot gnu.org [this message] 2020-06-24 16:32 ` redi at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-95851-4-OLlWH7OhjW@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).