diff options
Diffstat (limited to 'src/backend/parser/parse_param.c')
-rw-r--r-- | src/backend/parser/parse_param.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/parser/parse_param.c b/src/backend/parser/parse_param.c index dbf1a7dff08..b617591ef68 100644 --- a/src/backend/parser/parse_param.c +++ b/src/backend/parser/parse_param.c @@ -31,6 +31,7 @@ #include "parser/parse_param.h" #include "utils/builtins.h" #include "utils/lsyscache.h" +#include "utils/memutils.h" typedef struct FixedParamState @@ -136,7 +137,7 @@ variable_paramref_hook(ParseState *pstate, ParamRef *pref) Param *param; /* Check parameter number is in range */ - if (paramno <= 0 || paramno > INT_MAX / sizeof(Oid)) + if (paramno <= 0 || paramno > MaxAllocSize / sizeof(Oid)) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_PARAMETER), errmsg("there is no parameter $%d", paramno), |