Add size check in NativeConverter JNI code
Adding an addition check to avoid copying arbitrary-length bytes/chars into a statically allocated array. In reality this is very unlikely to happen as the encoder replacement length is checked in Java via an if (len > maxBytesPerChar) in all cases. The decoder replacement is either hardcoded (and below the limit), or checked when it is set via withReplacement(). Bug: 63876067 Test: Ran org.apache.harmony.tests.java.nio.charset.Charset.*Test Change-Id: Id6a7c5cc05a72dc84c405fee18e3e5a0f5f6495b
Loading
Please sign in to comment