Re: CVE-2017-7484-induced bugs, or, btree cmp functions are not leakproof? - Mailing list pgsql-hackers

From Amit Langote
Subject Re: CVE-2017-7484-induced bugs, or, btree cmp functions are not leakproof?
Date
Msg-id CA+HiwqG9HqH+ZYGNLN47jXmLxUoJE9bquYG_VsW98gLveF+AmQ@mail.gmail.com
Whole thread Raw
In response to Re: CVE-2017-7484-induced bugs, or, btree cmp functions are not leakproof?  (Dilip Kumar <dilipbalaut@gmail.com>)
Responses Re: CVE-2017-7484-induced bugs, or, btree cmp functions are not leakproof?
List pgsql-hackers
On Thu, Sep 5, 2019 at 6:33 PM Dilip Kumar <dilipbalaut@gmail.com> wrote:
>   /*
> + * For inheritance child relations, we also need to remember
> + * the root parent.
> + */
> + if (parent->rtekind == RTE_RELATION)
> + rel->inh_root_relid = parent->inh_root_relid > 0 ?
> + parent->inh_root_relid :
> + parent->relid;
> + else
> + /* Child relation of flattened UNION ALL subquery. */
> + rel->inh_root_relid = relid;
>
> With the current changes, parent->inh_root_relid will always be > 0 so
> (parent->inh_root_relid > 0) condition doesn't make sence. Right?

Oops, you're right.  It should be:

if (parent->rtekind == RTE_RELATION)
    rel->inh_root_relid = parent->inh_root_relid;
else
    rel->inh_root_relid = relid;

Updated patch attached.

Thanks,
Amit

Attachment

pgsql-hackers by date:

Previous
From: Esteban Zimanyi
Date:
Subject: Specifying attribute slot for storing/reading statistics
Next
From: Dilip Kumar
Date:
Subject: Re: CVE-2017-7484-induced bugs, or, btree cmp functions are not leakproof?