]> granicus.if.org Git - gc/commit
Fix GC_collect_or_expand to prevent allocation size value wrap-around
authorIvan Maidanski <ivmai@mail.ru>
Tue, 27 Sep 2016 07:12:18 +0000 (10:12 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 1 Nov 2016 21:34:27 +0000 (00:34 +0300)
commitd689fa55e193ea17414ed6a3269b30be3705f457
treebaa2fcfc9d8e50ae6c694c2867755675a107d9b1
parentf9c8aa30003f00ee27f4df0a34decf77a2918d4f
Fix GC_collect_or_expand to prevent allocation size value wrap-around

Relates to issue #135 on Github.

* alloc.c (GC_WORD_MAX): New macro.
* alloc.c (GC_collect_or_expand): Limit blocks_to_get by
GC_WORD_MAX / HBLKSIZE value (to avoid multiplication overflow in
GC_expand_hp_inner).
alloc.c