From 5f74d499bfc07c43f44d0989aab6b23c6b5bfbb0 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 17 Jun 1999 22:21:41 +0000 Subject: 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'. --- src/include/parser/parse_func.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/include/parser/parse_func.h') 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 #include + +#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 */ -- cgit v1.2.3