Re: BUG #18890: /src/timezone/localtime.c condition always false

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: dan-eli(at)mail(dot)ru
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18890: /src/timezone/localtime.c condition always false
Date: 2025-04-10 18:02:22
Message-ID: 537386.1744308142@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> On line 223 there is a check of string 'name' and in this case it is
> initiallized and then is being checked for null once more with no reason.

This code is taken from the upstream tzcode distribution, in which
TZDEFAULT can be NULL. (Or so I assume anyway without having looked.)
I'm disinclined to diverge from their code just to satisfy some static
analyzer complaining about useless code --- any reasonable C compiler
will discard that code, so it's not a problem.

> The code becomes quite buggy.

If there is actually a bug here, I'm not seeing it.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2025-04-10 18:04:39 Re: BUG #18891: /src/include/lib/simplehash.h possible palloc0 problems
Previous Message Tom Lane 2025-04-10 17:51:54 Re: BUG #18887: Inner join returns non-existent data.