> On 25 Aug 2026, at 08:57, Ewan Young <[email protected]> wrote:

> Negating PG_INT32_MIN overflows; under -fwrapv it comes back as
> PG_INT32_MIN, still negative, and pg_mbcharcliplen() returns 0 for any
> negative limit, so off is 0 and the whole string is returned.

Thanks for the report and patch, the fix seems correct to me.

> This dates to 49b27ab5514, which added left()/right() in 2010, and the
> line has not been touched since; I could not find a previous report.  

Understandably so, it's not an issue likely to cause issues in production.

> It's the same shape as b4dfae2ffac (money, INT64_MIN / -1) from a few weeks
> ago.

Agreed, so backpatching all the way for this one as well makes sense.  I'll
have another look and will leave it open to input from others before applying.

--
Daniel Gustafsson



Reply via email to