Skip to content

Commit

Permalink
8314149: Clipboard does inexact string comparison on mime type
Browse files Browse the repository at this point in the history
Reviewed-by: jdv, kcr, mstrauss
  • Loading branch information
arapte committed Aug 16, 2023
1 parent c3257fc commit 9e9c3b3
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -581,16 +581,13 @@ class ClipboardData : public IUnknownImpl<IDataObject>
static const STGMEDIUM empty_data = {0};
for (jsize i = 0; i < ckeys; ++i) {
JString mime(env, (jstring)env->GetObjectArrayElement(keys, i));
static const size_t fcsSize = wcslen(MS_FILE_CONTENT);
static const size_t gulSize = wcslen(GLASS_URI_LIST);
static const size_t gulAFNSize = wcslen(GLASS_IE_URL_SHORTCUT_FILENAME);
if (wcsncmp(MS_FILE_CONTENT, mime, fcsSize) == 0) {
if (wcscmp(MS_FILE_CONTENT, mime) == 0) {
//File content transfer.
//Need to be rewritten.
hasFileContent = true;
} else if (wcsncmp(GLASS_URI_LIST, mime, gulSize) == 0) {
} else if (wcscmp(GLASS_URI_LIST, mime) == 0) {
hasUrl = true;
} else if (wcsncmp(GLASS_IE_URL_SHORTCUT_FILENAME, mime, gulAFNSize) == 0) {
} else if (wcscmp(GLASS_IE_URL_SHORTCUT_FILENAME, mime) == 0) {
hasIEShortcutName = true;
//that is the synthetic mime, it would be translated to
//system pair MS_FILE_DESCRIPTOR_UNICODE/MS_FILE_CONTENT
Expand Down

1 comment on commit 9e9c3b3

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.