]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix some incorrect parsing of time with time zone strings
authorMichael Paquier <michael@paquier.xyz>
Wed, 7 Aug 2019 09:17:46 +0000 (18:17 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 7 Aug 2019 09:17:46 +0000 (18:17 +0900)
commit1ba4d0fe463eaf16bc93024d0634cf224f07a0e8
tree584e5b83645f753d2c6f80d82813a2f62ef8bad5
parent5b3e6c13f753cb10b476bf7755b5622aef2fbdce
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
src/backend/utils/adt/datetime.c
src/test/regress/expected/timetz.out
src/test/regress/sql/timetz.sql