]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Properly determine length for on-disk TOAST values
authorTomas Vondra <tomas.vondra@postgresql.org>
Sat, 16 Nov 2019 01:40:02 +0000 (02:40 +0100)
committerTomas Vondra <tomas.vondra@postgresql.org>
Sat, 16 Nov 2019 02:07:11 +0000 (03:07 +0100)
commit2dc08bd6179d8cf480c93701010c19ad7a9891d8
treee5d7ec8f6ee92ee76789599cc0028cfb71a6e2b9
parentd482f7f867b58bbd29f65a4471eca8c5b57a7da0
Properly determine length for on-disk TOAST values

In detoast_attr_slice, VARSIZE_ANY was used to compute compressed length
of on-disk TOAST values. That's incorrect, because the varlena value may
be just a TOAST pointer, producing either bogus value or crashing.

This is likely why the code was crashing on big-endian machines before
540f31680913 replaced the VARSIZE with VARSIZE_ANY, which however only
masked the issue.

Reported-by: Rushabh Lathia
Discussion: https://postgr.es/m/CAL-OGkthU9Gs7TZchf5OWaL-Gsi=hXqufTxKv9qpNG73d5na_g@mail.gmail.com
src/backend/access/common/detoast.c