pgsql: Fix string truncation to be multibyte-aware in text_name and bpc
pgsql: Fix string truncation to be multibyte-aware in text_name and bpc
От:
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 Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/d3b97d1488ba868f6bab12eeaf0b9ae75fad2566 Modified Files -------------- src/backend/utils/adt/name.c | 10 +++++++--- src/backend/utils/adt/varchar.c | 14 ++++---------- src/backend/utils/adt/varlena.c | 12 +++--------- 3 files changed, 14 insertions(+), 22 deletions(-)