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 1gVKSW-0005r2-Uv for pgsql-bugs@arkaria.postgresql.org; Fri, 07 Dec 2018 18:02:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gVKSU-00048f-Jx for pgsql-bugs@arkaria.postgresql.org; Fri, 07 Dec 2018 18:02:38 +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 1gVKSU-000475-9r for pgsql-bugs@lists.postgresql.org; Fri, 07 Dec 2018 18:02:38 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gVKSR-0006mO-AW for pgsql-bugs@lists.postgresql.org; Fri, 07 Dec 2018 18:02:36 +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 wB7I2UYT016266; Fri, 7 Dec 2018 13:02:30 -0500 From: Tom Lane To: bianpan2016@163.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15541: Use after release in PQprint In-reply-to: <15915.1544205176@sss.pgh.pa.us> References: <15541-c835d8b9a903f7ad@postgresql.org> <15915.1544205176@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 07 Dec 2018 12:52:56 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16264.1544205750.1@sss.pgh.pa.us> Date: Fri, 07 Dec 2018 13:02:30 -0500 Message-ID: <16265.1544205750@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > Wow, that is ancient. It looks like commit edb519b14 of 27-Jul-1996 > added the pipe close stanza in the wrong place, and nobody's noticed > it since. That's probably not so surprising given the multiple > conditions required to trigger it plus the fact that this whole > function is, if not completely dead code, at least not used anywhere > in the PG distribution. Still, we oughta fix it. Actually, looking closer at just what those conditions are: the giant bit of spaghetti code at lines 177-188 will never enable the pager if po->html3 is on. Probably that was because of laziness about counting lines correctly in that case, but anyway it means the problem situation is unreachable, AFAICS. It still seems worth fixing in HEAD, in case anyone ever tries to remove that restriction; but I'm no longer feeling that we need to back-patch it. regards, tom lane