Correct range checking in mallopt/mxfast/tcache [BZ #25194]
commit16554464bcd9d77b07c6ff419dc54f00e394fa50
authorDJ Delorie <dj@redhat.com>
Tue, 3 Dec 2019 22:44:36 +0000 (3 17:44 -0500)
committerDJ Delorie <dj@redhat.com>
Thu, 5 Dec 2019 21:46:37 +0000 (5 16:46 -0500)
tree94e8eee8e11e6b96705ddec99fa0b75ecf33b4c0
parent1f7525d924b608a3e43b10fcfb3d46b8a6e9e4f9
Correct range checking in mallopt/mxfast/tcache [BZ #25194]

do_set_tcache_max, do_set_mxfast:
Fix two instances of comparing "size_t < 0"
Both cases have upper limit, so the "negative value" case
is already handled via overflow semantics.

do_set_tcache_max, do_set_tcache_count:
Fix return value on error.  Note: currently not used.

mallopt:
pass return value of helper functions to user.  Behavior should
only be actually changed for mxfast, where we restore the old
(pre-tunables) behavior.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
malloc/malloc.c