mirror of
https://github.com/postgres/postgres.git
synced 2025-07-20 05:03:10 +03:00
Tigthen binary receive functions so that they reject values that the text
input functions don't accept either. While the backend can handle such values fine, they can cause trouble in clients and in pg_dump/restore. This is followup to the original issue on time datatype reported by Andrew McNamara a while ago. Like that one, none of these seem worth back-patching.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/oid.c,v 1.74 2009/01/01 17:23:49 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/oid.c,v 1.75 2009/09/04 11:20:22 heikki Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -276,13 +276,21 @@ oidvectorrecv(PG_FUNCTION_ARGS)
|
||||
|
||||
Assert(!locfcinfo.isnull);
|
||||
|
||||
/* sanity checks: oidvector must be 1-D, no nulls */
|
||||
/* sanity checks: oidvector must be 1-D, 0-based, no nulls */
|
||||
if (ARR_NDIM(result) != 1 ||
|
||||
ARR_HASNULL(result) ||
|
||||
ARR_ELEMTYPE(result) != OIDOID)
|
||||
ARR_ELEMTYPE(result) != OIDOID ||
|
||||
ARR_LBOUND(result)[0] != 0)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
|
||||
errmsg("invalid oidvector data")));
|
||||
|
||||
/* check length for consistency with oidvectorin() */
|
||||
if (ARR_DIMS(result)[0] > FUNC_MAX_ARGS)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("oidvector has too many elements")));
|
||||
|
||||
PG_RETURN_POINTER(result);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user