pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #16189: The usage of NULL pointer in indexpath.c
2+ messages / 2 participants
[nested] [flat]

* BUG #16189: The usage of NULL pointer in indexpath.c
@ 2020-01-06 03:37 PG Bug reporting form <noreply@postgresql.org>
  2020-01-06 04:11 ` Re: BUG #16189: The usage of NULL pointer in indexpath.c Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2020-01-06 03:37 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: starbugs@qq.com

The following bug has been logged on the website:

Bug reference:      16189
Logged by:          Jian Zhang
Email address:      starbugs@qq.com
PostgreSQL version: 12.1
Operating system:   Linux
Description:        

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”. The program should check the effectiveness
of the input parameter “rinfo” of the function
“match_saopclause_to_indexcol” and the input parameter “rinfo” of the
function “match_rowcompare_to_indexcol” to avoid these five errors.



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #16189: The usage of NULL pointer in indexpath.c
  2020-01-06 03:37 BUG #16189: The usage of NULL pointer in indexpath.c PG Bug reporting form <noreply@postgresql.org>
@ 2020-01-06 04:11 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2020-01-06 04:11 UTC (permalink / raw)
  To: starbugs@qq.com; +Cc: pgsql-bugs@lists.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





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2020-01-06 04:11 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06 03:37 BUG #16189: The usage of NULL pointer in indexpath.c PG Bug reporting form <noreply@postgresql.org>
2020-01-06 04:11 ` Tom Lane <tgl@sss.pgh.pa.us>

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