1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-29 10:41:53 +03:00

Defend against function calls with more than 8 arguments (code

used to overrun its fixed-size arrays before detecting error; not cool).
Also, replace uses of magic constant '8' with 'MAXFARGS'.
This commit is contained in:
Tom Lane
1999-06-17 22:21:41 +00:00
parent 4c65382596
commit 5f74d499bf
4 changed files with 33 additions and 23 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.41 1999/05/29 03:17:20 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.42 1999/06/17 22:21:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -712,7 +712,7 @@ SizeTargetExpr(ParseState *pstate,
int i;
HeapTuple ftup;
char *funcname;
Oid oid_array[8];
Oid oid_array[MAXFARGS];
FuncCall *func;
A_Const *cons;
@ -720,7 +720,7 @@ SizeTargetExpr(ParseState *pstate,
funcname = typeidTypeName(attrtype);
oid_array[0] = attrtype;
oid_array[1] = INT4OID;
for (i = 2; i < 8; i++)
for (i = 2; i < MAXFARGS; i++)
oid_array[i] = InvalidOid;
/* attempt to find with arguments exactly as specified... */