pg_mblen_range, pg_mblen_with_len: Valgrind after encoding ereport.

Noah Misch <noah@leadboat.com>

Commit: 4174e41b9e9ee552fff3501e73a1897c9f1eecaa
Author: Noah Misch <noah@leadboat.com>
Date: 2026-02-14T20:16:19Z
Releases: 18.3
pg_mblen_range, pg_mblen_with_len: Valgrind after encoding ereport.

The prior order caused spurious Valgrind errors.  They're spurious
because the ereport(ERROR) non-local exit discards the pointer in
question.  pg_mblen_cstr() ordered the checks correctly, but these other
two did not.  Back-patch to v14, like commit
1e7fe06c10c0a8da9dd6261a6be8d405dc17c728.

Reviewed-by: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/20260214053821.fa.noahmisch@microsoft.com
Backpatch-through: 14

Files

PathChange+/−
src/backend/utils/mb/mbutils.c modified +8 −6

Discussion