dtoolbase: Fix out-of-bounds access in pdtoa.cxx

This commit is contained in:
rdb 2025-10-15 21:22:34 +02:00
parent 77fa04adb0
commit c352e92dbc
1 changed files with 1 additions and 1 deletions

View File

@ -252,7 +252,7 @@ inline static unsigned CountDecimalDigit32(uint32_t n) {
}
inline static void DigitGen(const DiyFp& W, const DiyFp& Mp, uint64_t delta, char* buffer, int* len, int* K) {
static const uint32_t kPow10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 0, 0, 0, 0, 0 };
static const uint32_t kPow10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 0, 0, 0, 0, 0, 0 };
const DiyFp one(uint64_t(1) << -Mp.e, Mp.e);
const DiyFp wp_w = Mp - W;
uint32_t p1 = static_cast<uint32_t>(Mp.f >> -one.e);