diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 1999-06-17 22:21:41 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 1999-06-17 22:21:41 +0000 |
commit | 5f74d499bfc07c43f44d0989aab6b23c6b5bfbb0 (patch) | |
tree | 235f522a4c20f8acfcb04ec73883631607c12ce0 /src/include/parser/parse_func.h | |
parent | 4c6538259659b6325da5205005846162c78fd593 (diff) | |
download | postgresql-5f74d499bfc07c43f44d0989aab6b23c6b5bfbb0.tar.gz postgresql-5f74d499bfc07c43f44d0989aab6b23c6b5bfbb0.zip |
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'.
Diffstat (limited to 'src/include/parser/parse_func.h')
-rw-r--r-- | src/include/parser/parse_func.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/include/parser/parse_func.h b/src/include/parser/parse_func.h index b83929358c5..d3441a0ce89 100644 --- a/src/include/parser/parse_func.h +++ b/src/include/parser/parse_func.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: parse_func.h,v 1.15 1999/05/25 16:14:27 momjian Exp $ + * $Id: parse_func.h,v 1.16 1999/06/17 22:21:40 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -20,6 +20,9 @@ #include <parser/parse_func.h> #include <parser/parse_node.h> + +#define MAXFARGS 8 /* max # args to a c or postquel function */ + /* * This structure is used to explore the inheritance hierarchy above * nodes in the type tree in order to disambiguate among polymorphic @@ -47,7 +50,7 @@ extern Node *ParseNestedFuncOrColumn(ParseState *pstate, Attr *attr, extern Node *ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs, int *curr_resno, int precedence); -extern void - func_error(char *caller, char *funcname, int nargs, Oid *argtypes, char *msg); +extern void func_error(char *caller, char *funcname, + int nargs, Oid *argtypes, char *msg); #endif /* PARSE_FUNC_H */ |