RE: [PATCH][BUG_FIX] Potential null pointer dereferencing.

From: Ranier Vilela <ranier_gyn(at)hotmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: [PATCH][BUG_FIX] Potential null pointer dereferencing.
Date: 2019-11-12 14:03:53
Message-ID: MN2PR18MB2927BC110E8BDE8A93F9945BE3770@MN2PR18MB2927.namprd18.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
The condition is :
74. if (TupIsNull(slot)) is true
85. if (TupIsNull(resultTupleSlot)) is true too.

If resultTupleSlot is not can be NULL, why test if (TupIsNull(resultTupleSlot))?
Occurring these two conditions ExecClearTuple is called, but, don't check by NULL arg.

There are at least 2 more possible cases, envolving ExecClearTuple:
nodeFunctionscan.c and nodeWindowAgg.c

Best regards,
Ranier Vilela

________________________________________
De: Daniel Gustafsson <daniel(at)yesql(dot)se>
Enviado: terça-feira, 12 de novembro de 2019 13:43
Para: Ranier Vilela
Cc: PostgreSQL Hackers
Assunto: Re: [PATCH][BUG_FIX] Potential null pointer dereferencing.

> On 12 Nov 2019, at 14:07, Ranier Vilela <ranier_gyn(at)hotmail(dot)com> wrote:

> ExecClearTuple don't check por NULL pointer arg and according
> TupIsNull slot can be NULL.

I assume you are referring to the TupIsNull(resultTupleSlot) check a few lines
down in the same loop? If resultTupleSlot was indeed NULL and not empty, the
subsequent call to ExecCopySlot would be a NULL pointer dereference too. I
might be missing something obvious, but in which case can resultTupleSlot be
NULL when calling ExecUnique?

cheers ./daniel

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Luis Carril 2019-11-12 14:21:38 Re: Option to dump foreign data in pg_dump
Previous Message Daniel Gustafsson 2019-11-12 13:43:35 Re: [PATCH][BUG_FIX] Potential null pointer dereferencing.