RFR: 8296496: Overzealous check in sizecalc.h prevents large memory allocation

Alexander Zuev kizune at openjdk.org
Tue Nov 8 21:42:35 UTC 2022


On Tue, 8 Nov 2022 13:50:25 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

> Each parameter must be cast as in SAFE_SIZE_ARRAY_ALLOC.

If we do that then logic might be broken since we checking for the limits against the (size_t)(m * n) but performing call with ((size_t)(m) * (size_t)(n)) which might add potential point of failure. I prefer to do the conversions in the same way we do them in checks.

-------------

PR: https://git.openjdk.org/jdk/pull/11030



More information about the client-libs-dev mailing list