[BUG] (firsttupleslot)==NULL is redundant or is possible null dereference?

From: Ranier Vilela <ranier_gyn(at)hotmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: [BUG] (firsttupleslot)==NULL is redundant or is possible null dereference?
Date: 2019-11-22 22:32:11
Message-ID: MN2PR18MB292769EAD143EE4C574C5468E3490@MN2PR18MB2927.namprd18.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
This is real bug? firsttupleslot == NULL.

\backend\executor\nodeGroup.c
if (TupIsNull(firsttupleslot))
{
outerslot = ExecProcNode(outerPlanState(node));
if (TupIsNull(outerslot))
{
/* empty input, so return nothing */
node->grp_done = true;
return NULL;
}
/* Copy tuple into firsttupleslot */
ExecCopySlot(firsttupleslot, outerslot);

include\executor\tuptable.h:
#define TupIsNull(slot) \
((slot) == NULL || TTS_EMPTY(slot))

static inline TupleTableSlot *
ExecCopySlot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
{
Assert(!TTS_EMPTY(srcslot));

dstslot->tts_ops->copyslot(dstslot, srcslot);

return dstslot;
}

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2019-11-22 22:54:15 Re: [BUG] (firsttupleslot)==NULL is redundant or is possible null dereference?
Previous Message David Steele 2019-11-22 22:30:18 Re: backup manifests