aboutsummaryrefslogtreecommitdiff
path: root/contrib/jsonb_plpython/sql/jsonb_plpython.sql
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2025-02-15 16:20:21 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2025-02-15 16:20:21 -0500
commit991a60a9f23bd2b160e223c46bb2ae1db58f738a (patch)
treee0b0fc0ccc420bf246ec9049bbb9e2bfc3253e05 /contrib/jsonb_plpython/sql/jsonb_plpython.sql
parent111f4dd273c840426d296c3b2ed0c5c67e3f4c37 (diff)
downloadpostgresql-991a60a9f23bd2b160e223c46bb2ae1db58f738a.tar.gz
postgresql-991a60a9f23bd2b160e223c46bb2ae1db58f738a.zip
Make escaping functions retain trailing bytes of an invalid character.
Instead of dropping the trailing byte(s) of an invalid or incomplete multibyte character, replace only the first byte with a known-invalid sequence, and process the rest normally. This seems less likely to confuse incautious callers than the behavior adopted in 5dc1e42b4. While we're at it, adjust PQescapeStringInternal to produce at most one bleat about invalid multibyte characters per string. This matches the behavior of PQescapeInternal, and avoids the risk of producing tons of repetitive junk if a long string is simply given in the wrong encoding. This is a followup to the fixes for CVE-2025-1094, and should be included if cherry-picking those fixes. Author: Andres Freund <andres@anarazel.de> Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us> Reported-by: Jeff Davis <pgsql@j-davis.com> Discussion: https://postgr.es/m/20250215012712.45@rfd.leadboat.com Backpatch-through: 13
Diffstat (limited to 'contrib/jsonb_plpython/sql/jsonb_plpython.sql')
0 files changed, 0 insertions, 0 deletions