pg_locale.c: Fix REL_18_STABLE for srclen < 0.

Ensure that srclen >= 0 before calling strlower_c(), etc.

Commit 5f003855e7 backported strlower_c(), etc., to 18, but did not
account for the srclen < 0 behavior that existed in 18 (and was
removed later in version 19 with commit 6d22c67c3b).

No callers in core use the srclen < 0 behavior, but it's possible
(though unlikely) that extensions do.

This applies to REL_18_STABLE only.

Discussion: 
https://postgr.es/m/v36ssaygf7grb3qzfsjhtdzi7kqd45ds56nyuf7gi5qjml4qbb@ezmfqzmhlrs2

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/27e2afb492cd553093c92ea917d24651b5a9ae16

Modified Files
--------------
src/backend/utils/adt/pg_locale.c | 8 ++++++++
1 file changed, 8 insertions(+)

Reply via email to