aboutsummaryrefslogtreecommitdiff
path: root/contrib/pageinspect/gistfuncs.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2023-02-13 20:38:37 +1300
committerDavid Rowley <drowley@postgresql.org>2023-02-13 20:38:37 +1300
commit7da51590ed6cd46ff886e8e4d08e8703db9c2b5b (patch)
treebc411391f6e2e5e85427fe62c92f02358fcefdad /contrib/pageinspect/gistfuncs.c
parent836c31ba508c154bc4c4ebb6270761586a6df797 (diff)
downloadpostgresql-7da51590ed6cd46ff886e8e4d08e8703db9c2b5b.tar.gz
postgresql-7da51590ed6cd46ff886e8e4d08e8703db9c2b5b.zip
Fix incorrect presorted DISTINCT aggregate if condition
Here we fix a faulty "if" condition which failed to correctly handle two or more consecutive NULL transition values when checking if the new value is DISTINCT from the old value for presorted aggregates. Given a suitably non-strict aggregate transition function, a byref aggregate could cause a crash due to calling the type's equality function and passing along a (Datum) 0 value to test for equality, the equality function would then try to dereference that 0 Datum and segfault. For byval types, there'd have been no crash and the equality function would have seen that the two 0 Datums matched, which (only by chance) meant the calling code would have worked correctly. Here we ensure that we only call the equality function when neither of the input values are NULL. This code is all new as of 1349d2790, so no backpatch needed. Reported-by: Fujii Masao Discussion: https://postgr.es/m/860c6d6f-a3c5-3ae9-9da2-827177bede06@oss.nttdata.com
Diffstat (limited to 'contrib/pageinspect/gistfuncs.c')
0 files changed, 0 insertions, 0 deletions