Fix convert_case(), introduced in 5c40364dd6.
Jeff Davis <jdavis@postgresql.org>
Fix convert_case(), introduced in 5c40364dd6. Check source length before checking for NUL terminator to avoid reading one byte past the string end. Also fix unreachable bug when caller does not expect NUL-terminated result. Add unit test coverage of convert_case() in case_test.c, which makes it easier to reproduce the valgrind failure. Discussion: https://postgr.es/m/7a9fd36d-7a38-4dc2-e676-fc939491a95a@gmail.com Reported-by: Alexander Lakhin
Files
| Path | Change | +/− |
|---|---|---|
| src/common/unicode_case.c | modified | +3 −3 |
| src/common/unicode/case_test.c | modified | +98 −3 |
Discussion
- Built-in CTYPE provider 125 messages · 2023-12-05 → 2024-07-26