]> 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 06:31:11 +0000 (09:31 +0300)
commit0419f0011486bf8e9f68b44db73081ab92802676
tree0c12f6a1df92fc1e084c7e9c878850fc565e7d83
parent754fe9c33d8e9f6ca0744083e23cc8024ec63eac
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