Fix string truncation to be multibyte-aware in text_name and bpchar_name.
Tom Lane <tgl@sss.pgh.pa.us>
Fix string truncation to be multibyte-aware in text_name and bpchar_name. Previously, casts to name could generate invalidly-encoded results. Also, make these functions match namein() more exactly, by consistently using palloc0() instead of ad-hoc zeroing code. Back-patch to all supported branches. Karl Schnaitter and Tom Lane
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/name.c | modified | +7 −3 |
| src/backend/utils/adt/varchar.c | modified | +4 −10 |
| src/backend/utils/adt/varlena.c | modified | +3 −9 |