model-writtenrun 4643 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Thiago Nunes reported a heap-buffer overread in float8_to_char when precision limits shorten the formatted number but zero_end causes last_relevant to advance beyond its buffer, providing a reproducer and detailed diagnosis in #1.
- Tom Lane reproduced the issue under Valgrind after extending the format with additional zeroes and submitted a patch that caps the last_relevant adjustment at the number string's final character, with a regression test, in #2.
- Tom Lane committed #2 unchanged as b081fe4199, with backports to all supported versions.
- After the commit, Thiago Nunes said Tom's solution appeared to cover all cases and described his alternative local fix of recalculating zero_end from pre and post in #3.
- Tom Lane explained that zero_end must retain the position of the last zero format character in #4, and Thiago accepted that reasoning in #5; the alternative was not adopted, and the submitted fix had already landed despite Thiago's closing expectation that it was still pending.