Re: BUG #5416: int4inc() is wrong

Поиск
Список
Период
Сортировка
От John Regehr
Тема Re: BUG #5416: int4inc() is wrong
Дата
Msg-id 4BC66A57.2030809@cs.utah.edu
обсуждение исходный текст
Ответ на Re: BUG #5416: int4inc() is wrong  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #5416: int4inc() is wrong  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-bugs
Hi Tom,

> If you can show me rewrites of all the basic arithmetic operations that
> detect overflow in full compliance with the C standard, and are
> readable, portable, and efficient, I'm all ears.

These are the best ones that I know of:


https://www.securecoding.cert.org/confluence/display/seccode/INT32-C.+Ensure+that+operations+on+signed+integers+do+not+result+in+overflow

Even if you dislike these, please take a look at the safety checks for
shifts.  The current postgresql shift functions need to be strengthened,
and it is easy to do.

John Regehr

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Alex Soto Paez"
Дата:
Сообщение: BUG #5423: problems installing postgresql-8.4 deleted folder / .s.PGSQL.lock not initiate the connecti
Следующее
От: Martin von Gagern
Дата:
Сообщение: Re: build error: strlcat/strlcpy used from heimdal libroken.so