mike-jumper opened a new pull request, #853: URL: https://github.com/apache/guacamole-client/pull/853
The Java and JavaScript implementations of the Guacamole protocol parser may cause unexpected parsing failures due to those languages' use of UTF-16 internally for string representations and string length. In particular, characters involving high/low surrogates may end up with miscalculated length prefixes, ultimately causing the resulting instruction to fail to parse. These changes refactor both implementations to calculate lengths in a way that takes high/low surrogates into account, and refactor the tunnel implementations to use a common parser. The internal implementations of the length calculation (`codePointCount()` in Java and regex in JavaScript) were chosen after benchmarking the parser to verify that performance is not impacted. The "naive" solution (walking the string and counting codepoints manually) is _significantly_ slower, whereas the solution here is as fast as the old implementation (if not faster). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
