mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Fix crash when reading 'timezone = unknown' from postgresql.conf during
SIGHUP; it's not OK for an assign_hook to return a non-malloc'd string. Problem was introduced during timezone library rewrite.
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.112 2005/07/25 22:12:32 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.113 2005/08/08 23:39:01 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -346,10 +346,13 @@ assign_timezone(const char *value, bool doit, GucSource source)
|
||||
* pg_timezone_initialize() will eventually select a default
|
||||
* value from the environment.
|
||||
*/
|
||||
const char *curzone = pg_get_timezone_name(global_timezone);
|
||||
if (doit)
|
||||
{
|
||||
const char *curzone = pg_get_timezone_name(global_timezone);
|
||||
|
||||
if (curzone)
|
||||
value = curzone;
|
||||
if (curzone)
|
||||
value = curzone;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user