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>
Tue, 15 Nov 2016 12:42:56 +0000 (15:42 +0300)
commite22aaf50d0111ad5481081050d58a39e84e7ed87
tree08619720e0ff84636111d1d4678ab822b870e321
parent808af929bf55cd2b31e354f1903e182b151e8668
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