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

From Ranier Vilela
Subject Fix uninitialized variable access (src/backend/utils/mmgr/freepage.c)
Date
Msg-id CAEudQApiF6K4Vy0=0RYfz0Qy+=irGzne1YTnTiWE4XG3Joxuvw@mail.gmail.com
Whole thread Raw
Responses Re: Fix uninitialized variable access (src/backend/utils/mmgr/freepage.c)  (Mahendra Singh Thalor <mahi6run@gmail.com>)
List pgsql-hackers
Hi,

The function FreePageManagerPutInternal can access an uninitialized variable,
if the following conditions occur:

1. fpm->btree_depth != 0
2. relptr_off == 0 inside function (FreePageBtreeSearch)

Perhaps this is a rare situation, but I think it's worth preventing.

/* Search the btree. */
FreePageBtreeSearch(fpm, first_page, &result);
Assert(!result.found);
if (result.index > 0)   /* result.index is garbage or invalid here) */

regards,
Ranier Vilela
Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: make world and install-world without docs
Next
From: Dean Rasheed
Date:
Subject: Re: rand48 replacement