pgsql: Fix assorted integer-overflow hazards in varbit.c.
В списке pgsql-committers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | pgsql: Fix assorted integer-overflow hazards in varbit.c. |
| Дата | |
| Msg-id | E1bv964-0007XR-I1@gemulon.postgresql.org обсуждение исходный текст |
| Список | pgsql-committers |
Fix assorted integer-overflow hazards in varbit.c. bitshiftright() and bitshiftleft() would recursively call each other infinitely if the user passed INT_MIN for the shift amount, due to integer overflow in negating the shift amount. To fix, clamp to -VARBITMAXLEN. That doesn't change the results since any shift distance larger than the input bit string's length produces an all-zeroes result. Also fix some places that seemed inadequately paranoid about input typmods exceeding VARBITMAXLEN. While a typmod accepted by anybit_typmodin() will certainly be much less than that, at least some of these spots are reachable with user-chosen integer values. Andreas Seltenreich and Tom Lane Discussion: <87d1j2zqtz.fsf@credativ.de> Branch ------ REL9_2_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/a567b7c11b311e4ea3a2668591b48ae52021961d Modified Files -------------- src/backend/utils/adt/varbit.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
В списке pgsql-committers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера