Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit32af13f

Browse files
committed
Add missing check for too-few-inputs when replacing a zero-dimensional
array.
1 parent327d86c commit32af13f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎src/backend/utils/adt/arrayfuncs.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.103 2004/06/06 00:41:27 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.104 2004/06/08 20:28:21 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1837,6 +1837,12 @@ array_set_slice(ArrayType *array,
18371837
lb[i]=lowerIndx[i];
18381838
}
18391839

1840+
/* complain if too few source items; we ignore extras, however */
1841+
if (nelems<ArrayGetNItems(nSubscripts,dim))
1842+
ereport(ERROR,
1843+
(errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
1844+
errmsg("source array too small")));
1845+
18401846
returnconstruct_md_array(dvalues,nSubscripts,dim,lb,elmtype,
18411847
elmlen,elmbyval,elmalign);
18421848
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp