Re: [PATCH] Fix Uninitialized scalar variable (UNINIT) (src/backend/access/heap/heapam_handler.c) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: [PATCH] Fix Uninitialized scalar variable (UNINIT) (src/backend/access/heap/heapam_handler.c)
Date
Msg-id CAEudQArLzbqv1Ucu8_GSihaC=UQSBtfzBFmq1GF-TBLMrpQ2Lg@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Fix Uninitialized scalar variable (UNINIT) (src/backend/access/heap/heapam_handler.c)  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: [PATCH] Fix Uninitialized scalar variable (UNINIT) (src/backend/access/heap/heapam_handler.c)
List pgsql-hackers
Em ter., 25 de ago. de 2020 às 18:06, Alvaro Herrera <alvherre@2ndquadrant.com> escreveu:
On 2020-Aug-25, Ranier Vilela wrote:

> The variable root_offsets is read at line 1641, but, at this point,
> the content is unknown, so it is impossible to test works well.

Surely it is set by heap_get_root_tuples() in line 1347?  The root_blkno
variable is used exclusively to know whether root_offsets has been
initialized for the current block.
Hi Álvaro,

20. Condition hscan->rs_cblock != root_blkno, taking false branch.

If the variable hscan->rs_cblock is InvalidBlockNumber the test can
protect root_offsets fail.

The var root_blkno only is checked at line 1853.

regards,
Ranier Vilela

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [PATCH] Fix Uninitialized scalar variable (UNINIT) (src/backend/access/heap/heapam_handler.c)
Next
From: Alvaro Herrera
Date:
Subject: Re: [PATCH] Fix Uninitialized scalar variable (UNINIT) (src/backend/access/heap/heapam_handler.c)