Catch invalid typlens in a couple of places

Peter Eisentraut <peter@eisentraut.org>

Commit: 5a2967412f63f3b9390aa7b3af95e2fae0965ff8
Author: Peter Eisentraut <peter@eisentraut.org>
Date: 2019-11-04T08:14:44Z
Releases: 12.1
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>

Files

PathChange+/−
src/backend/utils/adt/datum.c modified +12 −10
src/backend/utils/adt/rowtypes.c modified +13 −11