Re: Fix uninitialized variable access (src/backend/utils/mmgr/freepage.c) - Mailing list pgsql-hackers

From Greg Nancarrow
Subject Re: Fix uninitialized variable access (src/backend/utils/mmgr/freepage.c)
Date
Msg-id CAJcOf-fYrDgsoK1-5PfpKaoeOcQUO_c_KMtOyn32HUZsU-vkYA@mail.gmail.com
Whole thread Raw
In response to Re: Fix uninitialized variable access (src/backend/utils/mmgr/freepage.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Responses Re: Fix uninitialized variable access (src/backend/utils/mmgr/freepage.c)  (Ranier Vilela <ranier.vf@gmail.com>)
List pgsql-hackers
On Tue, Aug 17, 2021 at 9:13 PM Ranier Vilela <ranier.vf@gmail.com> wrote:
>
> If that's conditions happen, all *result.index* touches are garbage.
>

The patch looks valid to me, as the "index" member is not set in the
"btp == NULL" case, and so has a junk value in the caller, and it's
being used to index an array,
BUT - isn't it also necessary to set the "split_pages" member to 0,
because it also is not currently being set, and so too will have a
junk value in this case (and it's possible for it to be referenced by
the caller in this case).
The "btp == NULL" case is not hit by any existing test cases, and does
seem to be a rare case.


Regards,
Greg Nancarrow
Fujitsu Australia



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: The Free Space Map: Problems and Opportunities
Next
From: Tom Lane
Date:
Subject: Re: Added schema level support for publication.