Re: BUG #16189: The usage of NULL pointer in indexpath.c
Tom Lane <[email protected]> Sun, 05 Jan 2020 23:11:27 -0500
| Newsgroups | gmane.comp.db.postgresql.bugs |
|---|---|
| Message-ID | <[email protected]> |
PG Bug reporting form <[email protected]> writes: > We checked the code in file =E2=80=9Cindexpath.c=E2=80=9D and there are = five errors > occurring in lines 2799, 2881, 2882, 2883 and 2884. These five errors ar= e > all caused by the usage of pointers with NULL values. The code in line 2= 799 > is =E2=80=9Cleftop =3D (Node *) linitial(saop->args);=E2=80=9D The point= er =E2=80=9Csoap=E2=80=9D mentioned in > this line is defined by the code in line 2786 as =E2=80=9CScalarArrayOpE= xpr *saop =3D > (ScalarArrayOpExpr *) rinfo->clause;=E2=80=9D, so it is assigned as the = =E2=80=9Cclause=E2=80=9D > field of the input pointer =E2=80=9Crinfo=E2=80=9D of function > =E2=80=9Cmatch_saopclause_to_indexcol=E2=80=9D. For the rest four errors= , the codes are > =E2=80=9Cleftop =3D (Node *) linitial(clause->largs);=E2=80=9D, =E2=80=9C= rightop =3D (Node *) > linitial(clause->rargs);=E2=80=9D, =E2=80=9Cexpr_op =3D linitial_oid(cla= use->opnos);=E2=80=9D, and > =E2=80=9Cexpr_coll =3D linitial_oid(clause->inputcollids);=E2=80=9D resp= ectively. The pointer > =E2=80=9Cclause=E2=80=9D mentioned in these four lines is defined by the= code in line 2853 > as =E2=80=9CRowCompareExpr *clause =3D (RowCompareExpr *) rinfo->clause;= =E2=80=9D, so it is > assigned as the =E2=80=9Cclause=E2=80=9D field of the input pointer =E2=80= =9Crinfo=E2=80=9D of function > =E2=80=9Cmatch_rowcompare_to_indexcol=E2=80=9D. 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