git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 370c94d) | patch
Add test of various escape functions
2025年2月10日 15:03:39 +0000 (10:03 -0500)
2025年2月10日 15:03:39 +0000 (10:03 -0500)
commit de4b92f3332b7ea3373ae7bad0d790473b3665e6
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
src/test/modules/Makefile diff | blob | blame | history
src/test/modules/test_escape/.gitignore [new file with mode: 0644] blob
src/test/modules/test_escape/Makefile [new file with mode: 0644] blob
src/test/modules/test_escape/t/001_test_escape.pl [new file with mode: 0644] blob
src/test/modules/test_escape/test_escape.c [new file with mode: 0644] blob
src/tools/msvc/Mkvcbuild.pm diff | blob | blame | history
src/tools/pgindent/typedefs.list diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /