mirror of
https://github.com/postgres/postgres.git
synced 2025-08-31 17:02:12 +03:00
Add missing check for too-few-inputs when replacing a zero-dimensional
array.
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.100 2003/09/25 06:58:03 petere Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.100.2.1 2004/06/08 20:28:29 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@@ -1841,6 +1841,12 @@ array_set_slice(ArrayType *array,
|
|||||||
lb[i] = lowerIndx[i];
|
lb[i] = lowerIndx[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* complain if too few source items; we ignore extras, however */
|
||||||
|
if (nelems < ArrayGetNItems(nSubscripts, dim))
|
||||||
|
ereport(ERROR,
|
||||||
|
(errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
|
||||||
|
errmsg("source array too small")));
|
||||||
|
|
||||||
return construct_md_array(dvalues, nSubscripts, dim, lb, elmtype,
|
return construct_md_array(dvalues, nSubscripts, dim, lb, elmtype,
|
||||||
elmlen, elmbyval, elmalign);
|
elmlen, elmbyval, elmalign);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user