RFR: 8224240: Properties.load fails to throw IAE on malformed unicode in certain circumstances

Daniel Fuchs daniel.fuchs at oracle.com
Tue May 21 10:48:41 UTC 2019


Hi Claes,

Looks good to me. But can you add a test for when
the malformed sequence is not at the end of a line,
and one for when it's not the first character in the
value?

Something like:

         checkMalformedUnicodeEscape("b=\\u012xyz\n");
         checkMalformedUnicodeEscape("b=x\\u012yz\n");
         checkMalformedUnicodeEscape("b=xyz\\u012\n");

best regards,

-- daniel


On 21/05/2019 09:58, Claes Redestad wrote:
> Hi,
> 
> found a bug in Properties.load that apparently has been around since
> Java 5. This patch adds proper bounds checking when decoding unicode
> sequences.
> 
> Bug:    https://bugs.openjdk.java.net/browse/JDK-8224240
> Webrev: http://cr.openjdk.java.net/~redestad/8224240/open.00
> 
> Since the fix means a behavior change in the error handling of certain
> malformed property files, a CSR has been filed.
> 
> Thanks!
> 
> /Claes



More information about the core-libs-dev mailing list