Skip to content

Commit

Permalink
Security check for validator function
Browse files Browse the repository at this point in the history
  • Loading branch information
markokr committed Feb 19, 2014
1 parent d703683 commit 6b2e8b2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main.c
Expand Up @@ -278,6 +278,9 @@ plproxy_validator(PG_FUNCTION_ARGS)
Oid oid = PG_GETARG_OID(0);
HeapTuple proc_tuple;

if (!CheckFunctionValidatorAccess(fcinfo->flinfo->fn_oid, funcoid))
PG_RETURN_VOID();

proc_tuple = SearchSysCache(PROCOID, ObjectIdGetDatum(oid), 0, 0, 0);
if (!HeapTupleIsValid(proc_tuple))
elog(ERROR, "cache lookup failed for function %u", oid);
Expand Down

0 comments on commit 6b2e8b2

Please sign in to comment.