| От | John Regehr |
|---|---|
| Тема | BUG #5416: int4inc() is wrong |
| Дата | |
| Msg-id | 201004130544.o3D5iS45040175@wwwmaster.postgresql.org обсуждение исходный текст |
| Ответы |
Re: BUG #5416: int4inc() is wrong
|
| Список | pgsql-bugs |
The following bug has been logged online: Bug reference: 5416 Logged by: John Regehr Email address: regehr@cs.utah.edu PostgreSQL version: git head Apr 12 Operating system: n/a Description: int4inc() is wrong Details: The overflow check in int4inc() from int.c is wrong. The problem is that in C, signed overflow is undefined. Both LLVM and GCC eliminate the overflow check in this function. This is easy to see by looking at the asm emitted by either compiler. There are several easy ways to fix this code. One would be to test arg against INT_MAX before incrementing. Another would be to cast arg to unsigned, increment it, then do the check.
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера