Re: ARRNELEMS Out-of-bounds possible errors - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ARRNELEMS Out-of-bounds possible errors
Date
Msg-id 2919523.1671897927@sss.pgh.pa.us
Whole thread Raw
In response to Re: ARRNELEMS Out-of-bounds possible errors  (Nikita Malakhov <hukutoc@gmail.com>)
Responses Re: ARRNELEMS Out-of-bounds possible errors  (Nikita Malakhov <hukutoc@gmail.com>)
List pgsql-hackers
Nikita Malakhov <hukutoc@gmail.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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Error-safe user functions
Next
From: Andrew Dunstan
Date:
Subject: Re: Error-safe user functions