]> granicus.if.org Git - gc/commit
Fix potential integer overflow in GC_find_limit_* functions
authorIvan Maidanski <ivmai@mail.ru>
Tue, 15 Nov 2016 12:25:54 +0000 (15:25 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 27 Nov 2016 08:47:43 +0000 (11:47 +0300)
commitd6087481b3e70d93c53badf4ecee4ef5c130d573
tree523b4fcc28ee6f1d9bdc994519f5b0714cd71093
parent88c54c0a4ba428db7f0bc481e47e19ae25efba85
Fix potential integer overflow in GC_find_limit_* functions

* os_dep.c [OPENBSD] (GC_find_limit_openbsd, GC_skip_hole_openbsd): Add
assertion for the minimum value of bound; increment result by pgsz only
if no overflow is guaranteed.
* os_dep.c [USE_PROC_FOR_LIBRARIES && THREADS || NEED_FIND_LIMIT]
(GC_find_limit_with_bound): Add assertion for the minimum/maximum value
of bound; increment/decrement result by MIN_PAGE_SIZE only if no
overflow/underflow is guaranteed.
os_dep.c