Re: [PATCH] Check for TupleTableSlot nullness before dereferencing - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: [PATCH] Check for TupleTableSlot nullness before dereferencing
Date
Msg-id FDD95AB2-17BF-4C52-A8A9-682115FB4684@yesql.se
Whole thread Raw
Responses Re: [PATCH] Check for TupleTableSlot nullness before dereferencing
List pgsql-hackers
> On 3 Oct 2024, at 09:47, Alexander Kuznetsov <kuznetsovam@altlinux.org> wrote:
>
> Hello everyone,
>
> I'd like to propose adding check for nullness of
> TupleTableSlot before dereferencing it in /src/backend/executor/nodeAgg.c
>
> It is done in the same manner other TupleTableSlots are checked,
> but was probably left unseen because slot1 and slot2 variables
> can be swapped during function execution.

From a quick reading we can only reach there after evaluating an expression, so
can it really be null though?  This code hasn't changed all that much since
2009, if there was a reachable segfault on a null pointer deref I have a
feeling we'd heard about it by now so some extra care seems warranted to ensure
it's not a static analyzer false positive.

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Using per-transaction memory contexts for storing decoded tuples
Next
From: Daniel Gustafsson
Date:
Subject: Re: Retire support for OpenSSL 1.1.1 due to raised API requirements