commit | 016bffe83415ea3d3069399012d432e935900eee | [log] [tgz] |
---|---|---|
author | MarcoFalke <falke.marco@gmail.com> | Wed Nov 10 20:34:31 2021 +0100 |
committer | Copybara-Service <copybara-worker@google.com> | Wed Nov 10 12:28:58 2021 -0800 |
tree | ce7d337448d618e313efb6111ae8cd30ef4d3a90 | |
parent | 2462f791f62426f67aff095c0b6ea98758ed0a11 [diff] |
[libc++] Fix segmentation fault in __do_put_integral 6 chars are not sufficient to represent all formats for 64 bit integers. This was accidentally introduced in commit b889cbf36635a302f5b77560f1769178f196c2c7 (https://reviews.llvm.org/D112830). This causes failures in downstream projects, for example: * https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40817 * https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40841 Differential Revision: https://reviews.llvm.org/D113600 GitOrigin-RevId: faa019c0e38e8cb33d7e7fee92aa548bd052939e
diff --git a/include/locale b/include/locale index 478ca1e..0397caf 100644 --- a/include/locale +++ b/include/locale
@@ -1476,7 +1476,7 @@ char const* __len) const { // Stage 1 - Get number in narrow char - char __fmt[6] = {'%', 0}; + char __fmt[8] = {'%', 0}; this->__format_int(__fmt+1, __len, is_signed<_Integral>::value, __iob.flags()); // Worst case is octal, with showbase enabled. Note that octal is always // printed as an unsigned value.