1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

Have LookupFuncName accept NULL argtypes for 0 args

Prior to this change, it requires to be passed a valid pointer just to
be able to pass it to a zero-byte memcmp, per 0a52d378b0.  Given the
strange resulting code in callsites, it seems better to test for the
case specifically and remove the requirement.

Reported-by: Ranier Vilela
Discussion: https://postgr.es/m/MN2PR18MB2927F24692485D754794F01BE3740@MN2PR18MB2927.namprd18.prod.outlook.com
Discussion: https://postgr.es/m/MN2PR18MB2927F6873DF2774A505AC298E3740@MN2PR18MB2927.namprd18.prod.outlook.com
This commit is contained in:
Alvaro Herrera
2019-11-12 17:04:46 -03:00
parent 8c951687f5
commit dcb7d3cafa
6 changed files with 11 additions and 13 deletions

View File

@ -475,13 +475,12 @@ static Oid
lookup_fdw_handler_func(DefElem *handler)
{
Oid handlerOid;
Oid funcargtypes[1]; /* dummy */
if (handler == NULL || handler->arg == NULL)
return InvalidOid;
/* handlers have no arguments */
handlerOid = LookupFuncName((List *) handler->arg, 0, funcargtypes, false);
handlerOid = LookupFuncName((List *) handler->arg, 0, NULL, false);
/* check that handler has correct return type */
if (get_func_rettype(handlerOid) != FDW_HANDLEROID)