Re: ARRNELEMS Out-of-bounds possible errors

From: Nikita Malakhov <hukutoc(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, ranier(dot)vf(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: ARRNELEMS Out-of-bounds possible errors
Date: 2022-12-26 18:45:28
Message-ID: CAN-LCVO5kS1tmvTwM8hMaVTMrWhjV00rWLfukMpECk9poZ_HKA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

My bad, I was misleaded by unconditional return in ereturn_domain.
Sorry for the noise.

On Sat, Dec 24, 2022 at 7:05 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Nikita Malakhov <hukutoc(at)gmail(dot)com> writes:
> > Even with null context it does not turn to ereport, and returns dummy
> value
>
> Read the code. ArrayGetNItems passes NULL for escontext, therefore
> if there's a problem the ereturn calls in ArrayGetNItemsSafe will
> throw error, *not* return -1.
>
> Not sure how we could persuade Coverity of that, though,
> if it fails to understand that for itself.
>
> regards, tom lane
>

--
Regards,
Nikita Malakhov
Postgres Professional
https://postgrespro.ru/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2022-12-26 18:53:55 Re: ARRNELEMS Out-of-bounds possible errors
Previous Message Tom Lane 2022-12-26 17:47:02 Re: Error-safe user functions