diff options
author | Michael Paquier <michael@paquier.xyz> | 2020-07-22 14:52:50 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2020-07-22 14:52:50 +0900 |
commit | eceb415c6ff0eb2494f90397433a966a182f3908 (patch) | |
tree | 9dca3e40d3aaed9f3311ea4247afd0278981c99e /src/backend/storage/file/buffile.c | |
parent | 22b96f883fe2a454476b4d5fd69ee46b15889169 (diff) | |
download | postgresql-eceb415c6ff0eb2494f90397433a966a182f3908.tar.gz postgresql-eceb415c6ff0eb2494f90397433a966a182f3908.zip |
Fix corner case with PGP decompression in pgcrypto
A compressed stream may end with an empty packet, and PGP decompression
finished before reading this empty packet in the remaining stream. This
caused a failure in pgcrypto, handling this case as corrupted data.
This commit makes sure to consume such extra data, avoiding a failure
when decompression the entire stream. This corner case was reproducible
with a data length of 16kB, and existed since its introduction in
e94dd6a. A cheap regression test is added to cover this case.
Thanks to Jeff Janes for the extra investigation.
Reported-by: Frank Gagnepain
Author: Kyotaro Horiguchi, Michael Paquier
Discussion: https://postgr.es/m/16476-692ef7b84e5fb893@postgresql.org
Backpatch-through: 9.5
Diffstat (limited to 'src/backend/storage/file/buffile.c')
0 files changed, 0 insertions, 0 deletions