From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix some incorrect parsing of time with time zone strings
Date: Wed, 07 Aug 2019 09:19:16 +0000
Message-ID: <E1hvI6G-0008Qg-Gq@gemulon.postgresql.org> (raw)
Fix some incorrect parsing of time with time zone strings
When parsing a timetz string with a dynamic timezone abbreviation or a
timezone not specified, it was possible to generate incorrect timestamps
based on a date which uses some non-initialized variables if the input
string did not specify fully a date to parse. This is already checked
when a full timezone spec is included in the input string, but the two
other cases mentioned above missed the same checks.
This gets fixed by generating an error as this input is invalid, or in
short when a date is not fully specified.
Valgrind was complaining about this problem.
Bug: #15910
Author: Alexander Lakhin
Discussion: https://postgr.es/m/15910-2eba5106b9aa0c61@postgresql.org
Backpatch-through: 9.4
Branch
------
REL9_4_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/1f7943698182cb368974596251dce334171ea354
Modified Files
--------------
src/backend/utils/adt/datetime.c | 6 ++++++
src/test/regress/expected/timetz.out | 10 ++++++++++
src/test/regress/sql/timetz.sql | 5 +++++
3 files changed, 21 insertions(+)
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: michael@paquier.xyz
Subject: Re: pgsql: Fix some incorrect parsing of time with time zone strings
In-Reply-To: <E1hvI6G-0008Qg-Gq@gemulon.postgresql.org>
References: <E1hvI6G-0008Qg-Gq@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