From 6617c3878789b04d0b11fa986ab13c41fcf710d7 Mon Sep 17 00:00:00 2001 From: Taylor Vesely Date: Fri, 1 Jun 2018 01:34:40 +0859 Subject: [PATCH] Fix segfault with identify_system_timezone() The return value of tzparse() has changed as of commit b749790a, but a corresponding change to the tzparse() function in score_timezone() was never made. As a result, under certain circumstances the server might produce SIGSEGV while running identify_system_timezone(). Co-Authored-by: Jesse Zhang --- src/timezone/pgtz.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timezone/pgtz.c b/src/timezone/pgtz.c index 0602b724f9..84d7f5f69c 100644 --- a/src/timezone/pgtz.c +++ b/src/timezone/pgtz.c @@ -310,7 +310,7 @@ score_timezone(const char *tzname, struct tztry * tt) */ if (tzload(tzname, NULL, &tz.state, TRUE) != 0) { - if (tzname[0] == ':' || tzparse(tzname, &tz.state, FALSE) != 0) + if (tzname[0] == ':' || !tzparse(tzname, &tz.state, FALSE)) { return -1; /* can't handle the TZ name at all */ } -- GitLab