pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Ensure ParseTzFile() closes the input file after failing.
Date: Tue, 31 May 2022 18:47:58 +0000
Message-ID: <E1nw6uM-0024Hj-4s@gemulon.postgresql.org> (raw)

Ensure ParseTzFile() closes the input file after failing.

We hadn't noticed this because (a) few people feed invalid
timezone abbreviation files to the server, and (b) in typical
scenarios guc.c would throw ereport(ERROR) and then transaction
abort handling would silently clean up the leaked file reference.
However, it was possible to observe file leakage warnings if one
breaks an already-active abbreviation file, because guc.c does
not throw ERROR when loading supposedly-validated settings during
session start or SIGHUP processing.

Report and fix by Kyotaro Horiguchi (cosmetic adjustments by me)

Discussion: https://postgr.es/m/20220530.173740.748502979257582392.horikyota.ntt@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/16c80e7d0cdad933103968aec7cd024bca5274c0

Modified Files
--------------
src/backend/utils/misc/tzparser.c | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1nw6uM-0024Hj-4s@gemulon.postgresql.org>
Permalink:  ../E1nw6uM-0024Hj-4s@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nw6uM-0024Hj-4s@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Ensure ParseTzFile() closes the input file after failing.
  In-Reply-To: <E1nw6uM-0024Hj-4s@gemulon.postgresql.org>
  References: <E1nw6uM-0024Hj-4s@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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