Re: Minor binary-search int overflow in timezone code

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Minor binary-search int overflow in timezone code
Дата
Msg-id 21813.1418655100@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Minor binary-search int overflow in timezone code  (Christoph Berg <cb@df7cb.de>)
Ответы Re: Minor binary-search int overflow in timezone code  (Christoph Berg <cb@df7cb.de>)
Список 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 по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Custom timestamp format in logs
Следующее
От: Tom Lane
Дата:
Сообщение: Re: speedup tidbitmap patch: hash BlockNumber