Catch invalid typlens in a couple of places
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 4 Nov 2019 07:30:00 +0000 (08:30 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 4 Nov 2019 08:08:15 +0000 (09:08 +0100)
commit8557a6f10ca6f01f4b2f2f25e197292f3f46bb5c
tree6c6ee9092623cc14fac391eafdfbb4edd5b6cf48
parentdb27b60f07a039e236738fe90bd4215cafd35cf2
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 <pg@bowt.ie>
src/backend/utils/adt/datum.c
src/backend/utils/adt/rowtypes.c