1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-24 00:23:06 +03:00

Add test of various escape functions

As highlighted by the prior commit, writing correct escape functions is less
trivial than one might hope.

This test module tries to verify that different escaping functions behave
reasonably. It e.g. tests:

- Invalidly encoded input to an escape function leads to invalidly encoded
  output

- Trailing incomplete multi-byte characters are handled sensibly

- Escaped strings are parsed as single statement by psql's parser (which
  derives from the backend parser)

There are further tests that would be good to add. But even in the current
state it was rather useful for writing the fix in the prior commit.

Reviewed-by: Noah Misch <noah@leadboat.com>
Backpatch-through: 13
Security: CVE-2025-1094
This commit is contained in:
Andres Freund
2025-02-10 10:03:37 -05:00
parent 5dc1e42b4f
commit ac00ff1c96
8 changed files with 921 additions and 0 deletions

View File

@@ -3709,6 +3709,9 @@ pam_handle_t
parallel_worker_main_type
parse_error_callback_arg
partition_method_t
pe_test_config
pe_test_escape_func
pe_test_vector
pendingPosition
pending_label
pgParameterStatus