Merge pull request #4395 from akallabeth/afreerdp_clipboard_fix

[aFreeRDP] Check length of string returned by ClipboardGetData
This commit is contained in:
MartinHaimberger 2018-02-07 10:33:33 +01:00 committed by GitHub
commit 71bd654fd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -435,6 +435,7 @@ static UINT android_cliprdr_server_format_data_response(
formatId = ClipboardRegisterFormat(afc->clipboard, "UTF8_STRING");
data = (void*) ClipboardGetData(afc->clipboard, formatId, &size);
attached = jni_attach_thread(&env);
size = strnlen(data, size);
jdata = jniNewStringUTF(env, data, size);
freerdp_callback("OnRemoteClipboardChanged", "(JLjava/lang/String;)V", (jlong)instance,
jdata);