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

Thomas Stuefe stuefe at openjdk.java.net
Fri Feb 26 18:46:54 UTC 2021


This one is trivial and probably inconsequential, but lets fix it anyway.

There is a buffer overflow in both variants of UNICODE::as_utf8, where in case of truncation due to a zero length output buffer the terminating zero still gets written.

Added fix + gtest. Ran gtest.

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

Commit messages:
 - start

Changes: https://git.openjdk.java.net/jdk/pull/2753/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2753&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8262472
  Stats: 62 lines in 2 files changed: 61 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2753.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2753/head:pull/2753

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


More information about the hotspot-dev mailing list