RFR: JDK-8262472: Buffer overflow in UNICODE::as_utf8 for zero length output buffer

Thomas Stuefe stuefe at openjdk.java.net
Mon Mar 1 05:28:08 UTC 2021


On Mon, 1 Mar 2021 03:01:13 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Hi Thomas,
> 
> I'd rather treat passing a zero-length buffer as a programming error and assert the length is non-zero, rather than penalizing every correct call with an unnecessary precondition check.
> 
> Cheers,
> David

Hi David,

okay, I changed it to an assert. I looked at the callers and think this should be okay, but I am not perfectly sure. Lets hope we hit all cases with our tests.

Cheers, Thomas

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

PR: https://git.openjdk.java.net/jdk/pull/2753


More information about the hotspot-dev mailing list