Re: BUG #18799: /src/interfaces/ecpg/pgtypeslib/timestamp.c possible NULL deref

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 #18799: /src/interfaces/ecpg/pgtypeslib/timestamp.c possible NULL deref
Date: 2025-02-06 15:26:02
Message-ID: 1086778.1738855562@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:
> Pointer, returned from function 'localtime' at timestamp.c:141, may be NULL
> and is dereferenced at timestamp.c:142.In practice this shouldn't be a
> problem, but for strictness it's better to fix this. See
> 'src/bin/initdb/findtimezone.c' for example of proper handling.

I do not see an issue here. The only defined failure condition for
localtime() is timestamp-out-of-range, and we already checked the
range.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David Steele 2025-02-06 15:55:21 Re: Bug in recovery of drop database?
Previous Message Tom Lane 2025-02-06 15:17:35 Re: BUG #18797: pointer te->defn not checked for NULL