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

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Fix Uninitialized scalar variable (UNINIT) (src/backend/access/heap/heapam_handler.c)
Date: 2020-08-25 22:18:46
Message-ID: CAEudQArLzbqv1Ucu8_GSihaC=UQSBtfzBFmq1GF-TBLMrpQ2Lg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em ter., 25 de ago. de 2020 às 18:06, Alvaro Herrera <
alvherre(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2020-08-25 22:22:25 Re: ALTER SYSTEM between upgrades
Previous Message Alvaro Herrera 2020-08-25 21:06:34 Re: [PATCH] Fix Uninitialized scalar variable (UNINIT) (src/backend/access/heap/heapam_handler.c)