This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [patch] Correct range checking in mallopt/mxfast/tcache [BZ #25194]
- From: Jonathan Nieder <jrnieder at gmail dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 3 Dec 2019 19:42:33 -0800
- Subject: Re: [patch] Correct range checking in mallopt/mxfast/tcache [BZ #25194]
- References: <xn8sntvwfb.fsf@greed.delorie.com>
DJ Delorie wrote:
> Subject: 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 (undefined) overflow semantics.
nit: unsigned overflow is defined in C to wrap around, so we don't
have to worry about undefined behavior here.
This also changes the return value from these helpers. Forgive my
ignorance: where do they get called? I assumed it would be
__libc_mallopt, but I don't see any calls from there.
Thanks,
Jonathan