Integrated: 8304441: [macos] Crash when putting invalid unicode char on clipboard
Kevin Rushforth
kcr at openjdk.org
Thu Apr 6 11:38:16 UTC 2023
On Tue, 28 Mar 2023 15:09:29 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
> A malformed unicode string containing only half of a surrogate pair (either a high or low surrogate without the other half) will cause a native exception in the macOS `NSPasteboardItem setString:forType:` method. This uncaught exception will terminate (crash) the application.
>
> The fix is to validate the string before calling `setString:forType:`. I also added a try / catch that logs a warning, so that if we ever run into other exceptions, they won't be fatal.
>
> I added an automated test that fails on macOS without the fix and passes with the fix. The test is run on other platforms as well, and passes both before and after the fix.
This pull request has now been integrated.
Changeset: 2b2a7f1f
Author: Kevin Rushforth <kcr at openjdk.org>
URL: https://git.openjdk.org/jfx/commit/2b2a7f1f7cdad676159d471d2fee6025bbf4e939
Stats: 115 lines in 2 files changed: 113 ins; 0 del; 2 mod
8304441: [macos] Crash when putting invalid unicode char on clipboard
Reviewed-by: prr, angorya
-------------
PR: https://git.openjdk.org/jfx/pull/1074
More information about the openjfx-dev
mailing list