postgresql/src/common
Michael Paquier 8bb935d619 Fix off-by-one with NFC recomposition for Hangul U+11A7 (TBASE)
The NFC recomposition incorrectly included TBASE as a valid T syllable,
which is incorrect based on the Unicode specification (TBASE is one
below the start of the range, range beginning at U+11A8).

This would cause the TBASE to be silently swallowed in the
normalization, leading to an incorrect result.

A couple of regression tests are added to check more patterns with
Hangul recomposition and decomposition, on top of a test to check the
problem with TBASE.  Diego has submitted the code fix, and I have
written the tests.

Author: Diego Frias <mail@dzfrias.dev>
Co-authored-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/B92ED640-7D4A-4505-B09F-3548F58CBB16@dzfrias.dev
Backpatch-through: 14
2026-06-05 07:50:18 +09:00
..
unicode Update copyright for 2021 2021-01-02 13:06:25 -05:00
.gitignore Replace the data structure used for keyword lookup. 2019-01-06 17:02:57 -05:00
archive.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
base64.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
checksum_helper.c Add result size as argument of pg_cryptohash_final() for overflow checks 2021-02-15 10:18:34 +09:00
config_info.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
controldata_utils.c Try to handle torn reads of pg_control in frontend. 2023-10-16 17:23:25 +13:00
cryptohash.c Revert error handling improvements for cryptohashes 2022-01-14 11:25:39 +09:00
cryptohash_openssl.c Revert error handling improvements for cryptohashes 2022-01-14 11:25:39 +09:00
d2s.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
d2s_full_table.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
d2s_intrinsics.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
digit_table.h Change floating-point output format for improved performance. 2019-02-13 15:20:33 +00:00
encnames.c Fix comments for Korean encodings in encnames.c 2026-04-16 18:23:02 +12:00
exec.c Make EXEC_BACKEND more convenient on Linux and FreeBSD. 2023-02-08 13:09:27 +09:00
f2s.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
fe_memutils.c Make palloc_array() and friends safe against integer overflow. 2026-05-11 05:13:51 -07:00
file_perm.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
file_utils.c Replace pgwin32_is_junction() with lstat(). 2024-11-08 09:36:53 +10:30
hashfn.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
hmac.c Fix incorrect comments in hmac.c and hmac_openssl.c 2022-01-13 09:43:44 +09:00
hmac_openssl.c Fix incorrect comments in hmac.c and hmac_openssl.c 2022-01-13 09:43:44 +09:00
ip.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
jsonapi.c With GB18030, prevent SIGSEGV from reading past end of allocation. 2025-05-05 04:52:08 -07:00
keywords.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
kwlookup.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
link-canary.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
logging.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
Makefile Revert refactoring of hex code to src/common/ 2021-08-19 09:20:19 +09:00
md5.c Make fallback MD5 implementation thread-safe on big-endian systems 2024-08-07 10:44:16 +03:00
md5_common.c Revert error handling improvements for cryptohashes 2022-01-14 11:25:39 +09:00
md5_int.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_get_line.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_lzcompress.c Fix heap-buffer-overflow in pglz_decompress() on corrupt input. 2026-04-10 10:22:48 -04:00
pgfnames.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
protocol_openssl.c Suppress "has no symbols" linker warnings on macOS. 2026-04-29 12:25:09 -05:00
psprintf.c Unify src/common/'s definitions of MaxAllocSize. 2026-05-11 05:13:51 -07:00
relpath.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
restricted_token.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
rmtree.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
ryu_common.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
saslprep.c Unify src/common/'s definitions of MaxAllocSize. 2026-05-11 05:13:51 -07:00
scram-common.c Refactor HMAC implementations 2021-04-03 17:30:49 +09:00
sha1.c Adjust locations which have an incorrect copyright year 2021-06-04 12:19:50 +12:00
sha1_int.h Adjust locations which have an incorrect copyright year 2021-06-04 12:19:50 +12:00
sha2.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
sha2_int.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
sprompt.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
string.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
stringinfo.c Unify src/common/'s definitions of MaxAllocSize. 2026-05-11 05:13:51 -07:00
unicode_norm.c Fix off-by-one with NFC recomposition for Hangul U+11A7 (TBASE) 2026-06-05 07:50:18 +09:00
username.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
wait_error.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
wchar.c Fix mb2wchar functions on short input. 2026-02-09 12:38:12 +13:00