Re: Potential pointer dereference in plperl.c (caused by transforms patch)

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, peter_e(at)gmx(dot)net
Subject: Re: Potential pointer dereference in plperl.c (caused by transforms patch)
Date: 2015-11-30 12:33:51
Message-ID: CAB7nPqQW4OaEbS9mEDySJObGqtH9+MZMoC1FNqiYUXvCb1XKcg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Nov 28, 2015 at 5:29 AM, Noah Misch wrote:
> fcinfo->flinfo->fn_oid==InvalidOid implies an inline block, and those have no
> arguments. If it placates Coverity, I lean toward an assert-only change:

Oh, thanks. I missed this point.

> --- a/src/pl/plperl/plperl.c
> +++ b/src/pl/plperl/plperl.c
> @@ -2112,6 +2112,8 @@ plperl_call_perl_func(plperl_proc_desc *desc, FunctionCallInfo fcinfo)
> EXTEND(sp, desc->nargs);
>
> + /* Get signature for true functions; inline blocks have no args. */
> if (fcinfo->flinfo->fn_oid)
> get_func_signature(fcinfo->flinfo->fn_oid, &argtypes, &nargs);
> + Assert(nargs == desc->nargs);
>
> for (i = 0; i < desc->nargs; i++)

Yeah that looks fine.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2015-11-30 12:47:34 [PoC] Asynchronous execution again (which is not parallel)
Previous Message Ildus Kurbangaliev 2015-11-30 10:40:15 Re: [PATCH] Refactoring of LWLock tranches