[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] malloc: fix out-of-bounds read
From: |
Collin Funk |
Subject: |
Re: [PATCH] malloc: fix out-of-bounds read |
Date: |
Mon, 22 Jul 2024 23:08:26 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hi Chet,
Chet Ramey <chet.ramey@case.edu> writes:
>> /* Use this when we want to be sure that NB is in bucket NU. */
>> #define RIGHT_BUCKET(nb, nu) \
>> (((nb) > binsizes[(nu)-1]) && ((nb) <= binsizes[(nu)]))
>
> The right fix here is two-fold: fix the first test here to evaluate to 0
> if nu == 0, and change the call in internal_realloc similarly to how your
> patch changes it for the nunits - 1 case.
Ah, okay I see what you mean. Thanks.
Did you want a revised patch or do you have it under control?
Collin