Possible NULL dereferencing null pointer (src/backend/executor/nodeIncrementalSort.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Possible NULL dereferencing null pointer (src/backend/executor/nodeIncrementalSort.c)
Date: 2020-10-09 15:24:16
Message-ID: CAEudQAp90GsR2CK9BJcimj9E9Jw9bgm=-Tv3Bea3Co+1XSBkPw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I think that TupIsNull macro is no longer appropriate, to protect
ExecCopySlot.

See at tuptable.h:
#define TupIsNull(slot) \
((slot) == NULL || TTS_EMPTY(slot))

If var node->group_pivot is NULL, ExecCopySlot will
dereference a null pointer (first arg).

Maybe, this can be related to a bug reported in the btree deduplication.

regards,
Ranier Vilela

Attachment Content-Type Size
avoid_dereferencing_null_pointer.patch application/octet-stream 673 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2020-10-09 15:48:40 Re: [PATCH] ecpg: fix progname memory leak
Previous Message Bruce Momjian 2020-10-09 15:08:32 Re: Wrong example in the bloom documentation