From 4a9ed67e9d685a80c58d2377fbcaddffd0ddf57a Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Thu, 1 May 2025 07:14:50 -0400 Subject: [PATCH] LibWeb: Do not store clipboard items in an unprotected vector --- Libraries/LibWeb/Clipboard/Clipboard.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/LibWeb/Clipboard/Clipboard.cpp b/Libraries/LibWeb/Clipboard/Clipboard.cpp index 76f4b58907d..8d025d941c3 100644 --- a/Libraries/LibWeb/Clipboard/Clipboard.cpp +++ b/Libraries/LibWeb/Clipboard/Clipboard.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Tim Flynn + * Copyright (c) 2023-2025, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ @@ -167,10 +167,10 @@ GC::Ref Clipboard::write_text(String data) 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 { // 1. Let itemList be an empty sequence. - Vector> item_list; + GC::RootVector> item_list(realm.heap()); // 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.