[tz] tzcode: uninitialized sp->charcnt gives clang analyzer warning

Tom Lane tgl at sss.pgh.pa.us
Tue Aug 10 12:58:05 UTC 2021


Guy Harris via tz <tz at iana.org> writes:
> On Aug 9, 2021, at 3:55 PM, Jan Engelhardt via tz <tz at iana.org> wrote:
>> tzload then returns errno, which is 0 under these pretenses, thereby signalling
>> to its caller that everything was fine, when it fact it wasn't.

> Then it should be fixed not to do so, e.g. by returning ENOMEM if errno is 0.

I'm not quite sure which part you're saying should be fixed.
But it's entirely legal per C99 (not POSIX) for malloc not to
bother setting errno.  AFAICS, C99 doesn't even specify the
existence of ENOMEM.

			regards, tom lane


More information about the tz mailing list