Catch invalid typlens in a couple of places

Peter Eisentraut <peter@eisentraut.org>

Commit: 878a9b09c729a6ec6bc0b5e3a66b7715a18d0d8e
Author: Peter Eisentraut <peter@eisentraut.org>
Date: 2019-11-04T09:02:01Z
Releases: 9.5.20
Catch invalid typlens in a couple of places

Rearrange the logic in record_image_cmp() and record_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/rowtypes.c modified +61 −56