model-writtenrun 2926 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Ranier Vilela reported that bsearch_arg() accepts a size_t element count but uses an int loop counter, and proposed changing the counter to size_t to avoid overflow above INT_MAX in #1.
- Nathan Bossart traced the regression to the implementation change in PostgreSQL 14 and endorsed the patch in #2.
- Heikki Linnakangas committed the patch unchanged as de5afddc3b, with backpatching through PostgreSQL 14, and announced completion in #4.
- Heikki asked about the implementation's likely BSD or libiberty origins and suggested reporting the fix to other affected projects in #4; Ranier agreed to try in #5.
- Tomas Vondra recalled a likely BSD origin and questioned whether current allocation limits made the overflow reachable, while acknowledging that the older implementation handled it correctly, in #6.
- The overflow fix was fully landed by the end of the thread; Heikki considered current callers unlikely to approach INT_MAX elements and suggested a separate cleanup using bsearch_arg() to remove flagMode in dicts/spell.h, without submitting a patch, in #7.