Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ioJjs-0003uo-NP for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Jan 2020 04:11:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ioJjr-0004Ba-Gy for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Jan 2020 04:11:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ioJjr-0004BT-5n for pgsql-bugs@lists.postgresql.org; Mon, 06 Jan 2020 04:11:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ioJjk-0001eF-LO for pgsql-bugs@lists.postgresql.org; Mon, 06 Jan 2020 04:11:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 0064BRI3000886; Sun, 5 Jan 2020 23:11:27 -0500 From: Tom Lane To: starbugs@qq.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16189: The usage of NULL pointer in indexpath.c In-reply-to: <16189-26b2f5b6e884af2c@postgresql.org> References: <16189-26b2f5b6e884af2c@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Mon, 06 Jan 2020 03:37:43 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <884.1578283887.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 05 Jan 2020 23:11:27 -0500 Message-ID: <885.1578283887@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form 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