From: Tom Lane <tgl@sss.pgh.pa.us>
To: starbugs@qq.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16189: The usage of NULL pointer in indexpath.c
Date: Sun, 05 Jan 2020 23:11:27 -0500
Message-ID: <885.1578283887@sss.pgh.pa.us> (raw)
In-Reply-To: <16189-26b2f5b6e884af2c@postgresql.org>
References: <16189-26b2f5b6e884af2c@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> We checked the code in file “indexpath.c” and there are five errors
> occurring in lines 2799, 2881, 2882, 2883 and 2884. These five errors are
> all caused by the usage of pointers with NULL values. The code in line 2799
> is “leftop = (Node *) linitial(saop->args);” The pointer “soap” mentioned in
> this line is defined by the code in line 2786 as “ScalarArrayOpExpr *saop =
> (ScalarArrayOpExpr *) rinfo->clause;”, so it is assigned as the “clause”
> field of the input pointer “rinfo” of function
> “match_saopclause_to_indexcol”. For the rest four errors, the codes are
> “leftop = (Node *) linitial(clause->largs);”, “rightop = (Node *)
> linitial(clause->rargs);”, “expr_op = linitial_oid(clause->opnos);”, and
> “expr_coll = linitial_oid(clause->inputcollids);” respectively. The pointer
> “clause” mentioned in these four lines is defined by the code in line 2853
> as “RowCompareExpr *clause = (RowCompareExpr *) rinfo->clause;”, so it is
> assigned as the “clause” field of the input pointer “rinfo” of function
> “match_rowcompare_to_indexcol”.
And? You haven't given any reason to think that any of that is a problem.
It is true that this code is expecting that these lists aren't empty,
but that's checked upstream of here.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, starbugs@qq.com
Subject: Re: BUG #16189: The usage of NULL pointer in indexpath.c
In-Reply-To: <885.1578283887@sss.pgh.pa.us>
References: <16189-26b2f5b6e884af2c@postgresql.org> <885.1578283887@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox