Catch invalid typlens in a couple of places
authorPeter Eisentraut
Mon, 4 Nov 2019 07:30:00 +0000 (08:30 +0100)
committerPeter Eisentraut
Mon, 4 Nov 2019 08:14:44 +0000 (09:14 +0100)
commit5a2967412f63f3b9390aa7b3af95e2fae0965ff8
treedef4c7118217d04bcd18994da9ae721bc1cd5be8
parent6dd92138d1efd0da89e90b98bd71b76c3905f9aa
Catch invalid typlens in a couple of places

Rearrange the logic in record_image_cmp() and datum_image_eq() to
error out on unexpected typlens (either not supported there or
completely invalid due to corruption).  Barring corruption, this is
not possible today but it seems more future-proof and robust to fix
this.

Reported-by: Peter Geoghegan
src/backend/utils/adt/datum.c
src/backend/utils/adt/rowtypes.c