Commit 5788a567 authored by Tom Lane's avatar Tom Lane

Restore fullname[] contents before falling through in pg_open_tzfile().

Fix oversight in commit af2c5aa8: if the shortcut open() doesn't work,
we need to reset fullname[] to be just the name of the toplevel tzdata
directory before we fall through into the pre-existing code.  This failed
to be exposed in my (tgl's) testing because the fall-through path is
actually never taken under normal circumstances.

David Rowley, per report from Amit Kapila

Discussion: https://postgr.es/m/CAA4eK1LC7CaNhRAQ__C3ht1JVrPzaAXXhEJRnR5L6bfYHiLmWw@mail.gmail.com
parent 628462bd
...@@ -105,6 +105,7 @@ pg_open_tzfile(const char *name, char *canonname) ...@@ -105,6 +105,7 @@ pg_open_tzfile(const char *name, char *canonname)
if (result >= 0) if (result >= 0)
return result; return result;
/* If that didn't work, fall through to do it the hard way */ /* If that didn't work, fall through to do it the hard way */
fullname[fullnamelen] = '\0';
} }
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment