be50843754
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. |
||
---|---|---|
.. | ||
1.cc | ||
2.cc | ||
3.cc | ||
95851.cc | ||
chars_format.cc | ||
compare.cc | ||
lwg3266.cc | ||
requirements.cc |