Re: Minor binary-search int overflow in timezone code - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Minor binary-search int overflow in timezone code
Date
Msg-id 21813.1418655100@sss.pgh.pa.us
Whole thread Raw
In response to Minor binary-search int overflow in timezone code  (Christoph Berg <cb@df7cb.de>)
Responses Re: Minor binary-search int overflow in timezone code  (Christoph Berg <cb@df7cb.de>)
List pgsql-hackers
Christoph Berg <cb@df7cb.de> writes:
> a fellow Debian Developer found a minor glitch in
> src/timezone/localtime.c, where binary search is used. Now I don't
> think there is an actual problem (unless there's > 2^30 timezones),
> but it would at least make sense to mark the code as okayish so that
> people running code scanners won't stumble over the issue again.

> The attached patch added comments to address this.

This is totally silly.  The timecnt couldn't be anywhere near INT_MAX (in
fact, it is not allowed to exceed TZ_MAX_TIMES, which is currently just
1200).  And there are bunches of other instances of similar code in PG;
shall we put equally wishy-washy comments on them all?
        regards, tom lane



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Custom timestamp format in logs
Next
From: Tom Lane
Date:
Subject: Re: speedup tidbitmap patch: hash BlockNumber