postgresql/src/common
Tom Lane 2c63dc0356 Improve pglz_decompress's defenses against corrupt compressed data.
When processing a match tag, check to see if the claimed "off"
is more than the distance back to the output buffer start.
If it is, then the data is corrupt, and what's more we would
fetch from outside the buffer boundaries and potentially incur
a SIGSEGV.  (Although the odds of that seem relatively low, given
that "off" can't be more than 4K.)

Back-patch to v13; before that, this function wasn't really
trying to protect against bad data.

Report and fix by Flavien Guedez.

Discussion: https://postgr.es/m/01fc0593-e31e-463d-902c-dd43174acee2@oopacity.net
2023-10-18 20:43:17 -04:00
..
unicode
.gitignore
archive.c
base64.c
checksum_helper.c
config_info.c
controldata_utils.c Try to handle torn reads of pg_control in frontend. 2023-10-16 17:23:25 +13:00
cryptohash_openssl.c Revert error handling improvements for cryptohashes 2022-01-14 11:25:39 +09:00
cryptohash.c Revert error handling improvements for cryptohashes 2022-01-14 11:25:39 +09:00
d2s_full_table.h
d2s_intrinsics.h
d2s.c
digit_table.h
encnames.c
exec.c Make EXEC_BACKEND more convenient on Linux and FreeBSD. 2023-02-08 13:09:27 +09:00
f2s.c
fe_memutils.c
file_perm.c
file_utils.c Fix get_dirent_type() for symlinks on MinGW/MSYS. 2022-07-28 14:27:06 +12:00
hashfn.c
hmac_openssl.c Fix incorrect comments in hmac.c and hmac_openssl.c 2022-01-13 09:43:44 +09:00
hmac.c Fix incorrect comments in hmac.c and hmac_openssl.c 2022-01-13 09:43:44 +09:00
ip.c
jsonapi.c Fix JSON error reporting for many cases of erroneous string values. 2023-03-13 15:19:00 -04:00
keywords.c
kwlookup.c
link-canary.c
logging.c
Makefile Revert refactoring of hex code to src/common/ 2021-08-19 09:20:19 +09:00
md5_common.c Revert error handling improvements for cryptohashes 2022-01-14 11:25:39 +09:00
md5_int.h
md5.c
pg_get_line.c
pg_lzcompress.c Improve pglz_decompress's defenses against corrupt compressed data. 2023-10-18 20:43:17 -04:00
pgfnames.c
protocol_openssl.c
psprintf.c
relpath.c
restricted_token.c
rmtree.c
ryu_common.h
saslprep.c
scram-common.c
sha1_int.h
sha1.c
sha2_int.h
sha2.c
sprompt.c
string.c
stringinfo.c
unicode_norm.c Fix buffer overrun in unicode string normalization with empty input 2021-11-11 15:01:45 +09:00
username.c
wait_error.c
wchar.c Fix incautious handling of possibly-miscoded strings in client code. 2021-06-07 14:15:25 -04:00