aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistxlog.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2023-04-28 12:24:29 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2023-04-28 12:24:29 -0400
commit81eaaf65e393d03f49a781009fba876f81fe9d0b (patch)
tree3a3b09225de5d8bc1c132d52547108b78ff6dde0 /src/backend/access/gist/gistxlog.c
parent4dadd660f0719206ce3914d4ad9b6aad69d6db6e (diff)
downloadpostgresql-81eaaf65e393d03f49a781009fba876f81fe9d0b.tar.gz
postgresql-81eaaf65e393d03f49a781009fba876f81fe9d0b.zip
Handle zero-length sublist correctly in Python -> SQL array conversion.
If PLySequence_ToArray came across a zero-length sublist, it'd compute the overall array size as zero, possibly leading to a memory clobber. (This would likely qualify as a security bug, were it not that plpython is an untrusted language already.) I think there are other corner-case issues in this code as well, notably that the error messages don't match the core code and for some ranges of array sizes you'd get "invalid memory alloc request size" rather than the intended message about array size. Really this code has no business doing its own array size calculation at all, so remove the faulty code in favor of using ArrayGetNItems(). Per bug #17912 from Alexander Lakhin. Bug seems to have come in with commit 94aceed31, so back-patch to all supported branches. Discussion: https://postgr.es/m/17912-82ceed78731d9cdc@postgresql.org
Diffstat (limited to 'src/backend/access/gist/gistxlog.c')
0 files changed, 0 insertions, 0 deletions