commit | 91d364965955265776848b190b066c53e2dd5f6e | [log] [tgz] |
---|---|---|
author | Vladimir Marko <vmarko@google.com> | Mon Jul 19 11:59:42 2021 +0100 |
committer | Vladimir Marko <vmarko@google.com> | Mon Jul 19 14:48:55 2021 +0000 |
tree | 1b1b2b7e5323f7f3176149d1cc4f9ed4ac591416 | |
parent | 4b0ceb655f86d6be90be574349bdc55d24e5560c [diff] |
Fix trailing surrogate validation. The macro `U16_IS_SURROGATE_LEAD()` assumes that the input is a surrogate without checking that assumption. Use the `U16_IS_TRAIL()` macro instead to correctly validate the trailing surrogate in `CharsetUtils.toUtf8Bytes()`. Test: atest CtsLibcoreTestCases:libcore.java.lang.StringTest Bug: 193891113 Change-Id: Ib70d5a5b42c885ede3bf0e3bc087383c979f1f60