Skip to content

Commit 3117afa

Browse files
committed
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.
1 parent 2dd9672 commit 3117afa

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/backend/commands/variable.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.112 2005/07/25 22:12:32 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.113 2005/08/08 23:39:01 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -346,10 +346,13 @@ assign_timezone(const char *value, bool doit, GucSource source)
346346
* pg_timezone_initialize() will eventually select a default
347347
* value from the environment.
348348
*/
349-
const char *curzone = pg_get_timezone_name(global_timezone);
349+
if (doit)
350+
{
351+
const char *curzone = pg_get_timezone_name(global_timezone);
350352

351-
if (curzone)
352-
value = curzone;
353+
if (curzone)
354+
value = curzone;
355+
}
353356
}
354357
else
355358
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy