Re: Check for tuplestorestate nullness before dereferencing - Mailing list pgsql-hackers

From Ilia Evdokimov
Subject Re: Check for tuplestorestate nullness before dereferencing
Date
Msg-id c28626b6-5bfb-4ba1-bfd8-c821ded51985@tantorlabs.com
Whole thread Raw
Responses Re: Check for tuplestorestate nullness before dereferencing
List pgsql-hackers
On 14.10.2024 12:25, Alexander Kuznetsov wrote:
> Hello everyone,
>
> I'd like to propose adding a check for the nullness of tuplestorestate 
> before dereferencing it
> in src/backend/executor/nodeModifier.c. The patch is attached.
>
> I am proposing this fix based on the assumption that tuplestorestate 
> could be NULL
> since there is a check for it when calculating eof_tuplestore at line 85.
> However, since this code hasn't been changed since 2006 and hasn't 
> caused any issues,
> it is possible that the check for (tuplestorestate == NULL) is 
> redundant when calculating eof_tuplestore.
>

Hi Alexander,

The 'tuplestorestate' variable may be initialized at line 64 if it is 
NULL. You should consider initializing this variable earlier.

Regards,
Ilia Evdokimov,
Tantor Labs LLC.




pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Add support to TLS 1.3 cipher suites and curves lists
Next
From: Pavel Stehule
Date:
Subject: Re: Better error reporting from extension scripts (Was: Extend ALTER OPERATOR)