From a733e2a31c0c67ee262a1676c5ad8e0d7415dbbb Mon Sep 17 00:00:00 2001 From: Jonne Ransijn Date: Tue, 29 Oct 2024 20:04:39 +0100 Subject: [PATCH] LibWeb: Fix use-after-move in `URLSearchParams::update` This was previously still valid since the `Optional` move constructor copied its input, but since the move is now destructive, the code no longer works. --- Userland/Libraries/LibWeb/DOMURL/URLSearchParams.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/DOMURL/URLSearchParams.cpp b/Userland/Libraries/LibWeb/DOMURL/URLSearchParams.cpp index 3a78274ae66..4b531c033a4 100644 --- a/Userland/Libraries/LibWeb/DOMURL/URLSearchParams.cpp +++ b/Userland/Libraries/LibWeb/DOMURL/URLSearchParams.cpp @@ -228,7 +228,7 @@ void URLSearchParams::update() serialized_query = {}; // 4. Set query’s URL object’s URL’s query to serializedQuery. - m_url->set_query({}, move(serialized_query)); + m_url->set_query({}, serialized_query); // 5. If serializedQuery is null, then potentially strip trailing spaces from an opaque path with query’s URL object. if (!serialized_query.has_value())