Re: BUG #15541: Use after release in PQprint

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: bianpan2016(at)163(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15541: Use after release in PQprint
Date: 2018-12-07 17:52:56
Message-ID: 15915.1544205176@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

=?utf-8?q?PG_Bug_reporting_form?= <noreply(at)postgresql(dot)org> writes:
> The function PQprint releases the file hander fout via pclose or _pclose
> when usePipe is true. After that, fout is used again to write message
> "fputs("</table>\n", fout);".

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.

Thanks for the report!

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2018-12-07 18:02:30 Re: BUG #15541: Use after release in PQprint
Previous Message Alvaro Herrera 2018-12-07 17:22:46 Re: BUG #15540: Use after release in ExecuteTruncateGuts

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-12-07 18:02:30 Re: BUG #15541: Use after release in PQprint
Previous Message Andres Freund 2018-12-07 17:34:42 Re: make install getting slower