mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibWeb: Do not store clipboard items in an unprotected vector
This commit is contained in:
parent
cf6e2531d9
commit
4a9ed67e9d
Notes:
github-actions[bot]
2025-05-02 21:47:55 +00:00
Author: https://github.com/trflynn89
Commit: 4a9ed67e9d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4548
Reviewed-by: https://github.com/shannonbooth
1 changed files with 3 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
* Copyright (c) 2023-2025, Tim Flynn <trflynn89@ladybird.org>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -167,10 +167,10 @@ GC::Ref<WebIDL::Promise> Clipboard::write_text(String data)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1. Queue a global task on the clipboard task source, given realm’s global object, to perform the below steps:
|
// 3. Queue a global task on the clipboard task source, given realm’s global object, to perform the below steps:
|
||||||
queue_global_task(HTML::Task::Source::Clipboard, realm.global_object(), GC::create_function(realm.heap(), [&realm, promise, data = move(data)]() mutable {
|
queue_global_task(HTML::Task::Source::Clipboard, realm.global_object(), GC::create_function(realm.heap(), [&realm, promise, data = move(data)]() mutable {
|
||||||
// 1. Let itemList be an empty sequence<Blob>.
|
// 1. Let itemList be an empty sequence<Blob>.
|
||||||
Vector<GC::Ref<FileAPI::Blob>> item_list;
|
GC::RootVector<GC::Ref<FileAPI::Blob>> item_list(realm.heap());
|
||||||
|
|
||||||
// 2. Let textBlob be a new Blob created with: type attribute set to "text/plain;charset=utf-8", and its
|
// 2. Let textBlob be a new Blob created with: type attribute set to "text/plain;charset=utf-8", and its
|
||||||
// underlying byte sequence set to the UTF-8 encoding of data.
|
// underlying byte sequence set to the UTF-8 encoding of data.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue