diff options
author | Robert Haas <rhaas@postgresql.org> | 2022-04-04 10:36:23 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2022-04-04 10:36:23 -0400 |
commit | afb529e6772b4e2b065644a2204697eeaf6c9a96 (patch) | |
tree | 54ccaf4a8631f445724b565e4bfbcf5d455cf333 /src/backend/parser/parse_expr.c | |
parent | 40af10b571bdabbab06839d090083c9f9c2091d2 (diff) | |
download | postgresql-afb529e6772b4e2b065644a2204697eeaf6c9a96.tar.gz postgresql-afb529e6772b4e2b065644a2204697eeaf6c9a96.zip |
pg_basebackup: Fix code that thinks about LZ4 buffer size.
Before this patch, there was some code that tried to make sure that the
buffer was always big enough at the start, and then asserted that it
didn't need to be enlarged later. However, the code to make sure it was
big enough at the start doesn't actually work, and therefore it was
possible to fail an assertion and crash later.
Remove the code that tries to make sure the buffer is always big enough
at the start in favor of enlarging the buffer as we go along whenever
that is necessary.
The mistake probably happened because, on the server side, we do
actually need to guarantee that the buffer is big enough at the start
to avoid subsequent resizings. However, in that case, the calling
code makes promises about how much data it will provide at once, but
here, that's not the case.
Report by Justin Pryzby. Analysis by me. Patch by Dipesh Pandit.
Discussion: http://postgr.es/m/20220330143536.GG28503@telsasoft.com
Diffstat (limited to 'src/backend/parser/parse_expr.c')
0 files changed, 0 insertions, 0 deletions